def CheckTrafficStatePy(): currentTrafficState = ixNet.getAttribute(ixNet.getRoot()+'traffic', '-state') if currentTrafficState == '::ixNet::OK': return 'notRunning' elif currentTrafficState == 'stopped': return 'stopped' elif currentTrafficState == 'started': return 'started' elif currentTrafficState == 'locked': return 'locked' elif currentTrafficState == 'unapplied': return 'unapplied' elif currentTrafficState == 'startedWaitingForStreams': return 'startedWaitingForStreams' elif currentTrafficState == 'stoppedWaitingForStats': return 'stoppedWaitingForStats' else: return currentTrafficState