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 2012/04/22 08:21:42 UTC

svn commit: r1328801 - in /libcloud/trunk: CHANGES libcloud/compute/ssh.py test/compute/test_ssh_client.py

Author: tomaz
Date: Sun Apr 22 06:21:42 2012
New Revision: 1328801

URL: http://svn.apache.org/viewvc?rev=1328801&view=rev
Log:
Modify ParamikoSSHClient to connect to the SSH agent and automatically
look for private keys in ~/.ssh if the 'auth' and 'ssh_key' argument
is not specified when calling deploy_node. LIBCLOUD-182

Modified:
    libcloud/trunk/CHANGES
    libcloud/trunk/libcloud/compute/ssh.py
    libcloud/trunk/test/compute/test_ssh_client.py

Modified: libcloud/trunk/CHANGES
URL: http://svn.apache.org/viewvc/libcloud/trunk/CHANGES?rev=1328801&r1=1328800&r2=1328801&view=diff
==============================================================================
--- libcloud/trunk/CHANGES (original)
+++ libcloud/trunk/CHANGES Sun Apr 22 06:21:42 2012
@@ -60,6 +60,11 @@ Changes with Apache Libcloud in developm
       existing entries in .ssh/authorized_keys. ; LIBCLOUD-187
       [Jay Doane]
 
+    - Modify ParamikoSSHClient to connect to the SSH agent and automatically
+      look for private keys in ~/.ssh if the 'auth' and 'ssh_key' argument
+      is not specified when calling deploy_node. ; LIBCLOUD-182
+      [Tomaz Muraus]
+
   *) Storage
 
     - Large object upload support for CloudFiles driver

Modified: libcloud/trunk/libcloud/compute/ssh.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/compute/ssh.py?rev=1328801&r1=1328800&r2=1328801&view=diff
==============================================================================
--- libcloud/trunk/libcloud/compute/ssh.py (original)
+++ libcloud/trunk/libcloud/compute/ssh.py Sun Apr 22 06:21:42 2012
@@ -142,7 +142,8 @@ class ParamikoSSHClient(BaseSSHClient):
         elif self.key:
             conninfo['key_filename'] = self.key
         else:
-            raise Exception('must specify either password or key_filename')
+            conninfo['allow_agent'] = True
+            conninfo['look_for_keys'] = True
 
         if self.timeout:
             conninfo['timeout'] = self.timeout

Modified: libcloud/trunk/test/compute/test_ssh_client.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/test/compute/test_ssh_client.py?rev=1328801&r1=1328800&r2=1328801&view=diff
==============================================================================
--- libcloud/trunk/test/compute/test_ssh_client.py (original)
+++ libcloud/trunk/test/compute/test_ssh_client.py Sun Apr 22 06:21:42 2012
@@ -23,19 +23,7 @@ from mock import Mock
 
 
 class ParamikoSSHClientTests(unittest.TestCase):
-
-    def test_either_key_or_password_must_be_provided(self):
-        libcloud.compute.ssh.paramiko = Mock()
-        client = libcloud.compute.ssh.ParamikoSSHClient(hostname='foo.bar.com')
-
-        try:
-            client.connect()
-        except Exception:
-            e = sys.exc_info()[1]
-            self.assertTrue(str(e).find('must specify either password or')
-                            != -1)
-        else:
-            self.fail('Exception was not thrown')
+    pass
 
 
 if __name__ == '__main__':