1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-13 12:59:30 +03:00
Files
libvirt-python/libvirt-override-virNetwork.py
Daniel P. Berrangé 7b18e3bae8 fix class type instantiated when listing network ports
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-01-03 11:32:55 +00:00

12 lines
428 B
Python

def listAllPorts(self, flags=0):
"""List all ports on the network and returns a list of network port objects"""
ret = libvirtmod.virNetworkListAllPorts(self._o, flags)
if ret is None:
raise libvirtError("virNetworkListAllPorts() failed", conn=self)
retlist = list()
for domptr in ret:
retlist.append(virNetworkPort(self, _obj=domptr))
return retlist