From 2e307cf84eabefe994b8fe225bd9c468ecbc2a41 Mon Sep 17 00:00:00 2001 From: aticig Date: Fri, 27 May 2022 10:50:21 +0300 Subject: [PATCH 1/1] Update paramiko version to 2.11.0 Update paramiko version and increase auth_timeout and log paramiko operations in order to fix Authentication Failed error during ssh key injection Change-Id: I544850ae3ca5ff826b71deeacb71c5ab2308ee5a Signed-off-by: aticig --- RO-plugin/osm_ro_plugin/vimconn.py | 13 +++++++++++- .../update_paramiko-53f3302ea926bd0a.yaml | 21 +++++++++++++++++++ requirements.txt | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/update_paramiko-53f3302ea926bd0a.yaml diff --git a/RO-plugin/osm_ro_plugin/vimconn.py b/RO-plugin/osm_ro_plugin/vimconn.py index b2ba9790..2baa2022 100644 --- a/RO-plugin/osm_ro_plugin/vimconn.py +++ b/RO-plugin/osm_ro_plugin/vimconn.py @@ -757,6 +757,11 @@ class VimConnector: "chmod 644 ~/.ssh/authorized_keys", "chmod 700 ~/.ssh/", } + + logging.basicConfig( + format="%(asctime)s %(levelname)s %(name)s %(filename)s:%(lineno)s %(message)s" + ) + logging.getLogger("paramiko").setLevel(logging.DEBUG) client = paramiko.SSHClient() try: @@ -766,8 +771,14 @@ class VimConnector: pkey = None client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) + client.connect( - ip_addr, username=user, password=password, pkey=pkey, timeout=30 + ip_addr, + username=user, + password=password, + pkey=pkey, + timeout=30, + auth_timeout=60, ) for command in commands: diff --git a/releasenotes/notes/update_paramiko-53f3302ea926bd0a.yaml b/releasenotes/notes/update_paramiko-53f3302ea926bd0a.yaml new file mode 100644 index 00000000..4fbe1b0a --- /dev/null +++ b/releasenotes/notes/update_paramiko-53f3302ea926bd0a.yaml @@ -0,0 +1,21 @@ +####################################################################################### +# Copyright ETSI Contributors and Others. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. +####################################################################################### +--- +other: + - | + Update paramiko version and increase auth_timeout to fix "AuthenticationException" + error during ssh key injection diff --git a/requirements.txt b/requirements.txt index dd6155e0..39e2676c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -265,7 +265,7 @@ oslo.utils==4.12.2 # python-openstackclient packaging==21.3 # via oslo.utils -paramiko==2.10.3 +paramiko==2.11.0 # via # -r RO-SDN-dpb/requirements.in # -r RO-VIM-gcp/requirements.in -- 2.17.1