1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-18 04:59:33 +03:00
Files
libvirt-python/libvirt-override-virNetwork.py
Philipp Hahn abbd47f4ea override: Add manual PEP 484 type annotations
Signed-off-by: Philipp Hahn <hahn@univention.de>
2020-08-18 09:48:25 +00:00

12 lines
450 B
Python

def listAllPorts(self, flags: int = 0) -> List['virNetworkPort']:
"""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")
retlist = list()
for domptr in ret:
retlist.append(virNetworkPort(self, _obj=domptr))
return retlist