mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
python: treat flags as default argument with value 0
The following four functions have not changed because default arguments have to come after positional arguments. Changing them will break the the binding APIs. migrate(self, dconn, flags, dname, uri, bandwidth): migrate2(self, dconn, dxml, flags, dname, uri, bandwidth): migrateToURI(self, duri, flags, dname, bandwidth): migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):
This commit is contained in:
parent
28933c5574
commit
a515aaa9e4
@ -1489,6 +1489,8 @@ def buildWrappers(module):
|
|||||||
if n != index:
|
if n != index:
|
||||||
classes.write(", %s" % arg[0])
|
classes.write(", %s" % arg[0])
|
||||||
n = n + 1
|
n = n + 1
|
||||||
|
if arg[0] == "flags":
|
||||||
|
classes.write("=0");
|
||||||
classes.write("):\n")
|
classes.write("):\n")
|
||||||
writeDoc(module, name, args, ' ', classes)
|
writeDoc(module, name, args, ' ', classes)
|
||||||
n = 0
|
n = 0
|
||||||
|
@ -204,7 +204,7 @@
|
|||||||
self.domainEventCallbackID[ret] = opaque
|
self.domainEventCallbackID[ret] = opaque
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def listAllDomains(self, flags):
|
def listAllDomains(self, flags=0):
|
||||||
"""List all domains and returns a list of domain objects"""
|
"""List all domains and returns a list of domain objects"""
|
||||||
ret = libvirtmod.virConnectListAllDomains(self._o, flags)
|
ret = libvirtmod.virConnectListAllDomains(self._o, flags)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
@ -216,7 +216,7 @@
|
|||||||
|
|
||||||
return retlist
|
return retlist
|
||||||
|
|
||||||
def listAllStoragePools(self, flags):
|
def listAllStoragePools(self, flags=0):
|
||||||
"""Returns a list of storage pool objects"""
|
"""Returns a list of storage pool objects"""
|
||||||
ret = libvirtmod.virConnectListAllStoragePools(self._o, flags)
|
ret = libvirtmod.virConnectListAllStoragePools(self._o, flags)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
@ -228,7 +228,7 @@
|
|||||||
|
|
||||||
return retlist
|
return retlist
|
||||||
|
|
||||||
def listAllNetworks(self, flags):
|
def listAllNetworks(self, flags=0):
|
||||||
"""Returns a list of network objects"""
|
"""Returns a list of network objects"""
|
||||||
ret = libvirtmod.virConnectListAllNetworks(self._o, flags)
|
ret = libvirtmod.virConnectListAllNetworks(self._o, flags)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
@ -240,7 +240,7 @@
|
|||||||
|
|
||||||
return retlist
|
return retlist
|
||||||
|
|
||||||
def listAllInterfaces(self, flags):
|
def listAllInterfaces(self, flags=0):
|
||||||
"""Returns a list of interface objects"""
|
"""Returns a list of interface objects"""
|
||||||
ret = libvirtmod.virConnectListAllInterfaces(self._o, flags)
|
ret = libvirtmod.virConnectListAllInterfaces(self._o, flags)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
@ -252,7 +252,7 @@
|
|||||||
|
|
||||||
return retlist
|
return retlist
|
||||||
|
|
||||||
def listAllDevices(self, flags):
|
def listAllDevices(self, flags=0):
|
||||||
"""Returns a list of host node device objects"""
|
"""Returns a list of host node device objects"""
|
||||||
ret = libvirtmod.virConnectListAllNodeDevices(self._o, flags)
|
ret = libvirtmod.virConnectListAllNodeDevices(self._o, flags)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
@ -264,7 +264,7 @@
|
|||||||
|
|
||||||
return retlist
|
return retlist
|
||||||
|
|
||||||
def listAllNWFilters(self, flags):
|
def listAllNWFilters(self, flags=0):
|
||||||
"""Returns a list of network filter objects"""
|
"""Returns a list of network filter objects"""
|
||||||
ret = libvirtmod.virConnectListAllNWFilters(self._o, flags)
|
ret = libvirtmod.virConnectListAllNWFilters(self._o, flags)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
@ -276,7 +276,7 @@
|
|||||||
|
|
||||||
return retlist
|
return retlist
|
||||||
|
|
||||||
def listAllSecrets(self, flags):
|
def listAllSecrets(self, flags=0):
|
||||||
"""Returns a list of secret objects"""
|
"""Returns a list of secret objects"""
|
||||||
ret = libvirtmod.virConnectListAllSecrets(self._o, flags)
|
ret = libvirtmod.virConnectListAllSecrets(self._o, flags)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
def listAllSnapshots(self, flags):
|
def listAllSnapshots(self, flags=0):
|
||||||
"""List all snapshots and returns a list of snapshot objects"""
|
"""List all snapshots and returns a list of snapshot objects"""
|
||||||
ret = libvirtmod.virDomainListAllSnapshots(self._o, flags)
|
ret = libvirtmod.virDomainListAllSnapshots(self._o, flags)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"""Get the domain that a snapshot was created for"""
|
"""Get the domain that a snapshot was created for"""
|
||||||
return self.domain()
|
return self.domain()
|
||||||
|
|
||||||
def listAllChildren(self, flags):
|
def listAllChildren(self, flags=0):
|
||||||
"""List all child snapshots and returns a list of snapshot objects"""
|
"""List all child snapshots and returns a list of snapshot objects"""
|
||||||
ret = libvirtmod.virDomainSnapshotListAllChildren(self._o, flags)
|
ret = libvirtmod.virDomainSnapshotListAllChildren(self._o, flags)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
def listAllVolumes(self, flags):
|
def listAllVolumes(self, flags=0):
|
||||||
"""List all storage volumes and returns a list of storage volume objects"""
|
"""List all storage volumes and returns a list of storage volume objects"""
|
||||||
ret = libvirtmod.virStoragePoolListAllVolumes(self._o, flags)
|
ret = libvirtmod.virStoragePoolListAllVolumes(self._o, flags)
|
||||||
if ret is None:
|
if ret is None:
|
||||||
|
@ -85,7 +85,7 @@ def registerErrorHandler(f, ctx):
|
|||||||
Returns 1 in case of success."""
|
Returns 1 in case of success."""
|
||||||
return libvirtmod.virRegisterErrorHandler(f,ctx)
|
return libvirtmod.virRegisterErrorHandler(f,ctx)
|
||||||
|
|
||||||
def openAuth(uri, auth, flags):
|
def openAuth(uri, auth, flags=0):
|
||||||
ret = libvirtmod.virConnectOpenAuth(uri, auth, flags)
|
ret = libvirtmod.virConnectOpenAuth(uri, auth, flags)
|
||||||
if ret is None:raise libvirtError('virConnectOpenAuth() failed')
|
if ret is None:raise libvirtError('virConnectOpenAuth() failed')
|
||||||
return virConnect(_obj=ret)
|
return virConnect(_obj=ret)
|
||||||
|
Loading…
Reference in New Issue
Block a user