You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2020/04/04 20:45:07 UTC

[libcloud] 05/21: Fix lint.

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch 2.8.x
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit e8e01f9c60b493e5e8ca96d475279fab89fad976
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Mar 31 23:20:51 2020 +0200

    Fix lint.
---
 libcloud/compute/ssh.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libcloud/compute/ssh.py b/libcloud/compute/ssh.py
index fcc5d01..bacae1a 100644
--- a/libcloud/compute/ssh.py
+++ b/libcloud/compute/ssh.py
@@ -281,7 +281,9 @@ class ParamikoSSHClient(BaseSSHClient):
             conninfo['key_filename'] = self.key_files
 
         if self.key_material:
-            conninfo['pkey'] = self._get_pkey_object(key=self.key_material)
+            conninfo['pkey'] = self._get_pkey_object(
+                key=self.key_material,
+                passpharse=self.key_password)
 
         if not self.password and not (self.key_files or self.key_material):
             conninfo['allow_agent'] = True
@@ -300,7 +302,10 @@ class ParamikoSSHClient(BaseSSHClient):
                 key_material = fp.read()
 
             try:
-                pkey = self._get_pkey_object(key=key_material)
+                pkey = self._get_pkey_object(key=key_material,
+                                             passpharse=self.key_password)
+            except paramiko.ssh_exception.PasswordRequiredException as e:
+                raise e
             except Exception:
                 pass
             else: