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

Wayne Sun gsun at redhat.com
Tue Aug 16 07:18:40 UTC 2011


---
 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




More information about the libvir-list mailing list