def GetVportConnectedToPortPy(vport): # Return the physical port of the vport # ::ixNet::OBJ-/availableHardware/chassis:"10.205.4.35"/card:1/port:1 connectedTo = ixNet.getAttribute(vport, '-connectedTo') connectedTo = connectedTo.split('/')[3:] card = connectedTo[0].split(':')[1] port = connectedTo[1].split(':')[1] return card+'/'+port