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 2014/01/09 00:26:30 UTC

[4/6] git commit: Add a docstring which clariries how the auth works.

Add a docstring which clariries how the auth works.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/2fca84c7
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/2fca84c7
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/2fca84c7

Branch: refs/heads/trunk
Commit: 2fca84c766e84c72db0a187baff99f988a001925
Parents: 039cb79
Author: Tomaz Muraus <to...@apache.org>
Authored: Wed Jan 8 23:55:05 2014 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Thu Jan 9 00:06:19 2014 +0100

----------------------------------------------------------------------
 libcloud/compute/ssh.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/2fca84c7/libcloud/compute/ssh.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/ssh.py b/libcloud/compute/ssh.py
index 6b814ec..c4dec9b 100644
--- a/libcloud/compute/ssh.py
+++ b/libcloud/compute/ssh.py
@@ -164,6 +164,19 @@ class ParamikoSSHClient(BaseSSHClient):
     """
     def __init__(self, hostname, port=22, username='root', password=None,
                  key=None, timeout=None):
+        """
+        Note #1 `password` and `key` arguments are not mutually exclusive and
+        you can specify both. If you specify both, authentication is attempted
+        in the following order:
+
+        - The key passed in (if any)
+        - Any key we can find through an SSH agent
+        - Any "id_rsa" or "id_dsa" key discoverable in ~/.ssh/
+        - Plain username/password auth, if a password was given
+
+        Note #2: If a password protected key is user, `password` argument
+        represents a password which will be used to unlock the key file.
+        """
         super(ParamikoSSHClient, self).__init__(hostname, port, username,
                                                 password, key, timeout)
         self.client = paramiko.SSHClient()