def GetTopologyPortsNgpfPy(topologyName): # Gets all the ports associated with the Topology for topology in ixNet.getList(ixNet.getRoot(), 'topology'): currentName = ixNet.getAttribute(topology, '-name') if currentName is topologyName: topologyVports = ixNet.getAttribute(topology, '-vports') portList = '' for vport in topologyVports: portList.append(GetVportConnectedToPort(vport)) if 'portList' in vars(): return portList else: return