commit 1f00b5375076f0bf20888d3342ad459597b20f62
Author: Ramana Raja <email address hidden>
Date: Tue Jan 20 12:51:57 2015 +0530
utils: Allow discovery of private key in ~/.ssh
A SSHPool class object, used to hold ssh connections, fails to
authenticate to the server in its create () method if the path to
SSH private key or user password is not passed during object creation.
The create () method does not allow private key to be discovered in
the default ~/.ssh folder when trying to authenticate or connect
to the SSH server. Instead allow auto discovery of the key in the
paramiko SSHClient's connect method (called in create () method) if the
path to private key or password is not provided.
Also make the following minor cleanups in the
create() method of SSHPool class:
- pass the path to the key file input directly to the SSHClient's
connect () method using the appropriate parameter, keyfile, instead
of picking key from key file and passing that as 'pkey' parameter.
- restrict the try except block to only the steps involved in
connecting to the SSH server.
- reraise the exception that would be raised by the Paramiko library
instead of raising own exception.
initialization method of SSHPool class:
- rename the attribute privatekey as path_to_private_key to accurately
reflect what it refers to, the path of the private key file.
Reviewed: https:/ /review. openstack. org/148534 /git.openstack. org/cgit/ openstack/ manila/ commit/ ?id=1f00b537507 6f0bf20888d3342 ad459597b20f62
Committed: https:/
Submitter: Jenkins
Branch: master
commit 1f00b5375076f0b f20888d3342ad45 9597b20f62
Author: Ramana Raja <email address hidden>
Date: Tue Jan 20 12:51:57 2015 +0530
utils: Allow discovery of private key in ~/.ssh
A SSHPool class object, used to hold ssh connections, fails to
authenticate to the server in its create () method if the path to
SSH private key or user password is not passed during object creation.
The create () method does not allow private key to be discovered in
the default ~/.ssh folder when trying to authenticate or connect
to the SSH server. Instead allow auto discovery of the key in the
paramiko SSHClient's connect method (called in create () method) if the
path to private key or password is not provided.
Also make the following minor cleanups in the
create() method of SSHPool class:
- pass the path to the key file input directly to the SSHClient's
connect () method using the appropriate parameter, keyfile, instead
of picking key from key file and passing that as 'pkey' parameter.
- restrict the try except block to only the steps involved in
connecting to the SSH server.
- reraise the exception that would be raised by the Paramiko library
instead of raising own exception.
initialization method of SSHPool class:
- rename the attribute privatekey as path_to_private_key to accurately
reflect what it refers to, the path of the private key file.
Change-Id: I590702d97086d3 3245894fd686250 e75e8e359f2
Closes-Bug: #1412782