本文整理汇总了Python中mininet.util.fixLimits函数的典型用法代码示例。如果您正苦于以下问题:Python fixLimits函数的具体用法?Python fixLimits怎么用?Python fixLimits使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fixLimits函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init
def init(cls):
"Initialize Mininet"
if cls.inited:
return
ensureRoot()
fixLimits()
cls.inited = True
示例2: init
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
示例3: use
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
示例4: init
def init(cls):
"Initialize Mininet"
if cls.inited:
return
fixLimits()
cls.inited = True