mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
python: Fix bindings for virDomainSnapshotGet{Domain,Connect}
https://bugzilla.redhat.com/show_bug.cgi?id=895882 virDomainSnapshot.getDomain() and virDomainSnapshot.getConnect() wrappers around virDomainSnapshotGet{Domain,Connect} were not supposed to be ever implemented. The class should contain proper domain() and connect() accessors that fetch python objects stored internally within the class. While domain() was already provided, connect() was missing. This patch adds connect() method to virDomainSnapshot class and reimplements getDomain() and getConnect() methods as aliases to domain() and connect() for backward compatibility.
This commit is contained in:
@@ -527,6 +527,8 @@ skip_function = (
|
||||
"virNWFilterGetConnect",
|
||||
"virStoragePoolGetConnect",
|
||||
"virStorageVolGetConnect",
|
||||
"virDomainSnapshotGetConnect",
|
||||
"virDomainSnapshotGetDomain",
|
||||
|
||||
# only useful in C code, python code uses dict for typed parameters
|
||||
"virTypedParamsAddBoolean",
|
||||
@@ -953,7 +955,6 @@ classes_destructors = {
|
||||
|
||||
class_skip_connect_impl = {
|
||||
"virConnect" : True,
|
||||
"virDomainSnapshot": True,
|
||||
}
|
||||
|
||||
class_domain_impl = {
|
||||
@@ -1436,6 +1437,7 @@ def buildWrappers(module):
|
||||
" self._conn = conn._conn\n")
|
||||
elif classname in [ "virDomainSnapshot" ]:
|
||||
classes.write(" self._dom = dom\n")
|
||||
classes.write(" self._conn = dom.connect()\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