]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix connection lookup in python storage instances
authorDaniel Veillard <veillard@redhat.com>
Tue, 12 Aug 2008 08:11:09 +0000 (08:11 +0000)
committerDaniel Veillard <veillard@redhat.com>
Tue, 12 Aug 2008 08:11:09 +0000 (08:11 +0000)
* python/generator.py: patch from Cole Robinson trying to fix
  problem of connection lookup when creating storage instances
Daniel

ChangeLog
python/generator.py

index 68ede54419ff1df978f72527f828a7e517ff67d3..c2e450d6ca9cd6aa2555168fb0a3fba23259bad6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Aug 12 10:09:23 CEST 2008 Daniel Veillard <veillard@redhat.com>
+
+       * python/generator.py: patch from Cole Robinson trying to fix
+         problem of connection lookup when creating storage instances
+
 Tue Aug 12 10:04:33 CEST 2008 Daniel Veillard <veillard@redhat.com>
 
        * po/*: regeneration of pot file, updates of .po
index 01a17da512b0743f1884439cd7854bde86d13375..c706b19ff2170fd281ba06ace4b1cd2b7659b8a9 100755 (executable)
@@ -962,8 +962,12 @@ def buildWrappers():
                    list = reference_keepers[classname]
                    for ref in list:
                        classes.write("        self.%s = None\n" % ref[1])
-                if classname in [ "virDomain", "virNetwork", "virStoragePool", "virStorageVol" ]:
+                if classname in [ "virDomain", "virNetwork" ]:
                     classes.write("        self._conn = conn\n")
+                elif classname in [ "virStorageVol", "virStoragePool" ]:
+                    classes.write("        self._conn = conn\n" + \
+                                  "        if not isinstance(conn, virConnect):\n" + \
+                                  "            self._conn = conn._conn\n")
                classes.write("        if _obj != None:self._o = _obj;return\n")
                classes.write("        self._o = None\n\n");
            destruct=None