本文整理汇总了Python中mininet.util.errFail函数的典型用法代码示例。如果您正苦于以下问题:Python errFail函数的具体用法?Python errFail怎么用?Python errFail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了errFail函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: mountDirs
def mountDirs( self, dirs ):
"Mount a list of directories"
for dir_ in dirs:
mountpoint = self.root + dir_
#print mountpoint
errFail( 'mount -B %s %s' %
( dir_, mountpoint ) )
开发者ID:netgroup,项目名称:Dreamer-Mininet-Deployer,代码行数:7,代码来源:oshi.py
示例2: mountPrivateDirs
def mountPrivateDirs( self ):
"Create and bind mount private dirs"
for dir_ in self.privateDirs:
privateDir = self.private + dir_
errFail( 'mkdir -p ' + privateDir )
mountPoint = self.root + dir_
errFail( 'mount -B %s %s' %
( privateDir, mountPoint) )
开发者ID:09beeihaq,项目名称:Coursera-SDN-Assignments,代码行数:8,代码来源:bind.py
示例3: cleanup
def cleanup( self ):
"""Clean up, then unmount bind mounts
unmount: actually unmount bind mounts?"""
# Wait for process to actually terminate
self.shell.wait()
Host.cleanup( self )
if self.unmount:
self.unmountBindMounts()
errFail( 'rmdir ' + self.root )
开发者ID:09beeihaq,项目名称:Coursera-SDN-Assignments,代码行数:9,代码来源:bind.py
示例4: setCPUs
def setCPUs(self, cores, mems=0):
"Specify (real) cores that our cgroup can run on"
if type(cores) is list:
cores = ",".join([str(c) for c in cores])
self.cgroupSet(resource="cpuset", param="cpus", value=cores)
# Memory placement is probably not relevant, but we
# must specify it anyway
self.cgroupSet(resource="cpuset", param="mems", value=mems)
# We have to do this here after we've specified
# cpus and mems
errFail("cgclassify -g cpuset:/%s %s" % (self.name, self.pid))
开发者ID:sjas,项目名称:mininet,代码行数:11,代码来源:node.py
示例5: __init__
def __init__( self, name, sched='cfs', **kwargs ):
Host.__init__( self, name, **kwargs )
# Initialize class if necessary
if not CPULimitedHost.inited:
CPULimitedHost.init()
# Create a cgroup and move shell into it
self.cgroup = 'cpu,cpuacct,cpuset:/' + self.name
errFail( 'cgcreate -g ' + self.cgroup )
# We don't add ourselves to a cpuset because you must
# specify the cpu and memory placement first
errFail( 'cgclassify -g cpu,cpuacct:/%s %s' % ( self.name, self.pid ) )
# BL: Setting the correct period/quota is tricky, particularly
# for RT. RT allows very small quotas, but the overhead
# seems to be high. CFS has a mininimum quota of 1 ms, but
# still does better with larger period values.
self.period_us = kwargs.get( 'period_us', 100000 )
self.sched = sched
self.rtprio = 20
开发者ID:RimHaw,项目名称:mn-ccnx,代码行数:18,代码来源:node.py
示例6: mountPoints
def mountPoints():
"Return list of mounted file systems"
mtab, _err, _ret = errFail( 'cat /proc/mounts' )
lines = mtab.split( '\n' )
mounts = []
for line in lines:
if not line:
continue
fields = line.split( ' ')
mount = fields[ 1 ]
mounts.append( mount )
return mounts
开发者ID:netgroup,项目名称:Dreamer-Mininet-Extensions,代码行数:12,代码来源:utility.py
示例7: createBindMounts
def createBindMounts( self ):
"""Create a chroot directory structure,
with self.privateDirs as private dirs"""
errFail( 'mkdir -p '+ self.rundir )
unmountAll( self.rundir )
# Create /root and /private directories
self.root = self.rundir + '/root'
self.private = self.rundir + '/private'
errFail( 'mkdir -p ' + self.root )
errFail( 'mkdir -p ' + self.private )
# Recursively mount / in private doort
# note we'll remount /sys and /proc later
errFail( 'mount -B / ' + self.root )
self.mountDirs( self.remounts )
self.mountPrivateDirs()
开发者ID:09beeihaq,项目名称:Coursera-SDN-Assignments,代码行数:15,代码来源:bind.py
注:本文中的mininet.util.errFail函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论