mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-04 12:21:57 +03:00
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
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user