1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-08-03 08:21:58 +03:00

fix class type instantiated when listing network ports

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2020-01-02 15:34:14 +00:00
parent 5efdfd042c
commit 7b18e3bae8

View File

@ -1,11 +1,11 @@
def listAllPorts(self, flags=0):
"""List all domains and returns a list of domain objects"""
"""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(virNetwork(self, _obj=domptr))
retlist.append(virNetworkPort(self, _obj=domptr))
return retlist