def RegenerateAllTrafficItemsPy(): for trafficItem in ixNet.getList(ixNet.getRoot()+'/traffic', 'trafficItem'): result = ixNet.execute('generate', trafficItem) if result != '::ixNet::OK': print '\nRegenerate_All_TrafficItems failed: ', trafficItem ixNet.disconnect() sys.exit() else: print '\nRegenerate_All_TrafficItems:', trafficItem