[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [libvirt-test-API][PATCH] fix the problem of return None value of self.conn



---
 lib/connectAPI.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/connectAPI.py b/lib/connectAPI.py
index 702a088..cfa4fea 100644
--- a/lib/connectAPI.py
+++ b/lib/connectAPI.py
@@ -44,7 +44,7 @@ class ConnectAPI(object):
 
     def open(self, uri):
         try:
-            conn = libvirt.open(uri)
+            self.conn = libvirt.open(uri)
             return self.conn
         except libvirt.libvirtError, e:
             message = e.get_error_message()
@@ -53,7 +53,7 @@ class ConnectAPI(object):
 
     def open_read_only(self, uri):
         try:
-            conn = libvirt.openReadOnly(uri)
+            self.conn = libvirt.openReadOnly(uri)
             return self.conn
         except libvirt.libvirtError, e:
             message = e.get_error_message()
@@ -62,7 +62,7 @@ class ConnectAPI(object):
 
     def openAuth(self, uri, auth, flags = 0):
         try:
-            conn = libvirt.openAuth(uri, auth, flags)
+            self.conn = libvirt.openAuth(uri, auth, flags)
             return self.conn
         except libvirt.libvirtError, e:
             message = e.get_error_message()
-- 
1.7.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]