libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [06/14] libcloud git commit: passing None to open will use defaults
Date Wed, 13 Jul 2016 09:44:20 GMT
passing None to open will use defaults

if we get a connection with None, retrive the connection uri from libvirt.virConnection

Signed-off-by: Tomaz Muraus <tomaz@tomaz.me>


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

Branch: refs/heads/trunk
Commit: 034c9a007c821db5c5bc61a690151025a599db33
Parents: 662e3b3
Author: Rene Kjellerup <rkjellerup@touchcommerce.com>
Authored: Tue Jul 12 12:34:52 2016 -0700
Committer: Tomaz Muraus <tomaz@tomaz.me>
Committed: Wed Jul 13 11:31:20 2016 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/libvirt_driver.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/034c9a00/libcloud/compute/drivers/libvirt_driver.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/libvirt_driver.py b/libcloud/compute/drivers/libvirt_driver.py
index 5586a6b..13b0c95 100644
--- a/libcloud/compute/drivers/libvirt_driver.py
+++ b/libcloud/compute/drivers/libvirt_driver.py
@@ -82,7 +82,7 @@ class LibvirtNodeDriver(NodeDriver):
         self._uri = uri
         self._key = key
         self._secret = secret
-        if '+tcp' in self._uri:
+        if uri is not None and '+tcp' in self._uri:
             if key is None and secret is None:
                 raise RuntimeError('The remote Libvirt instance requires ' +
                                    'authentication, please set \'key\' and ' +
@@ -92,8 +92,8 @@ class LibvirtNodeDriver(NodeDriver):
             self.connection = libvirt.openAuth(uri, auth, 0)
         else:
             self.connection = libvirt.open(uri)
-        if self.connection is None:
-            raise RuntimeError('Unable to establish a connection to libvirtd')
+        if uri is None:
+            self._uri = self.connection.getInfo()
 
     def _cred_callback(self, cred, user_data):
         """


Mime
View raw message