Comment 2 for bug 1412782

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/148534
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=1f00b5375076f0bf20888d3342ad459597b20f62
Submitter: Jenkins
Branch: master

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.

    Change-Id: I590702d97086d33245894fd686250e75e8e359f2
    Closes-Bug: #1412782