summaryrefslogtreecommitdiffstats
path: root/generator.py
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2008-08-12 08:11:09 +0000
committerDaniel Veillard <veillard@redhat.com>2008-08-12 08:11:09 +0000
commitb4f22f829d70a1ddc141a2c12229336907f0bbe9 (patch)
tree2f93f37191a8b9337f0156596ab9daa10815f2c6 /generator.py
parent1359729ea8f566fd2bdffede9389d945561b470f (diff)
downloadlibvirt-python-v6-b4f22f829d70a1ddc141a2c12229336907f0bbe9.tar.gz
libvirt-python-v6-b4f22f829d70a1ddc141a2c12229336907f0bbe9.tar.xz
libvirt-python-v6-b4f22f829d70a1ddc141a2c12229336907f0bbe9.zip
Fix connection lookup in python storage instances
* python/generator.py: patch from Cole Robinson trying to fix problem of connection lookup when creating storage instances Daniel
Diffstat (limited to 'generator.py')
-rwxr-xr-xgenerator.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/generator.py b/generator.py
index 01a17da..c706b19 100755
--- a/generator.py
+++ b/generator.py
@@ -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