def CreateTopologyPy(topologyName, vPorts): print '\nCreateTopology: %s : %s' % (topologyName, vPorts) topologyObj = ixNet.add(ixNet.getRoot(), 'topology') ixNet.setMultiAttribute(topologyObj, '-name', topologyName, '-vports', vPorts ) ixNet.commit() return topologyObj '\nVerifyTrafficState Error: Traffic failed to start' return 1 if trafficState is 'started': print '\nVerifyTrafficState: Traffic started' break if trafficState is 'stopped': print '\nVerifyTrafficState: Traffic stopped' break if trafficState in ['startedWaitingForStats', 'stoppedWaitingForStats']: print '\nVerifyTrafficState: Traffic started. Waiting for stats to complete' break if start < stopCounter: if trafficState not in ['started', 'startedWaitingForStats', 'stoppedWaitingForStats', 'stopped']: print '\nVerifyTrafficState: Current state = %s. Waiting %s/%s' % (trafficState, start, stopCounter) time.sleep(1)