def init(cls): "Initialize Mininet" if cls.inited: return ensureRoot() fixLimits() cls.inited = True
def init(): "Initialize Mininet." if init.inited: return if os.getuid() != 0: # Note: this script must be run as root # Perhaps we should do so automatically! print "*** Mininet must run as root." exit( 1 ) # If which produces no output, then mnexec is not in the path. # May want to loosen this to handle mnexec in the current dir. if not quietRun( 'which mnexec' ): raise Exception( "Could not find mnexec - check $PATH" ) fixLimits() init.inited = True
parser.add_argument('--switch', choices = switches.keys(), default = 'default', help = "Specify switch to use (see mininet doc)") # import sys # # print sys.argv args = parser.parse_args() #increase file descriptor limits from mininet.util import fixLimits fixLimits() if args.quiet >= 1: lg.setLogLevel('output') else: lg.setLogLevel('info') # topoFile = os.path.join(DIR, "data", args.tfile + ".json") topoFile = args.tfile if args.start_time is not None: EventsManager.start_time = int(args.start_time) # monitorUsage = args.monitorUsage import vars vars.watcher_log = args.watcher_log vars.testBinPath = args.bin_dir
parser.add_argument('--switch', choices=switches.keys(), default='default', help="Specify switch to use (see mininet doc)") # import sys # # print sys.argv args = parser.parse_args() #increase file descriptor limits from mininet.util import fixLimits fixLimits() if args.quiet >= 1: lg.setLogLevel('output') else: lg.setLogLevel('info') # topoFile = os.path.join(DIR, "data", args.tfile + ".json") topoFile = args.tfile if args.start_time is not None: EventsManager.start_time = int(args.start_time) # monitorUsage = args.monitorUsage import vars vars.watcher_log = args.watcher_log vars.testBinPath = args.bin_dir
def init(cls): "Initialize Mininet" if cls.inited: return fixLimits() cls.inited = True