MCPcopy Create free account
hub / github.com/mininet/mininet / popen

Method popen

mininet/node.py:741–756  ·  view source on GitHub ↗

Return a Popen() object in node's namespace args: Popen() args, single list, or string kwargs: Popen() keyword args

( self, *args, **kwargs )

Source from the content-addressed store, hash-verified

739 return exitcode == 0 or ( 'no such file' in _err.lower() )
740
741 def popen( self, *args, **kwargs ):
742 """Return a Popen() object in node's namespace
743 args: Popen() args, single list, or string
744 kwargs: Popen() keyword args"""
745 # Tell mnexec to execute command in our cgroup
746 mncmd = kwargs.pop( 'mncmd', [ 'mnexec', '-g', self.name,
747 '-da', str( self.pid ) ] )
748 # if our cgroup is not given any cpu time,
749 # we cannot assign the RR Scheduler.
750 if self.sched == 'rt':
751 if int( self.cgroupGet( 'rt_runtime_us', 'cpu' ) ) <= 0:
752 mncmd += [ '-r', str( self.rtprio ) ]
753 else:
754 debug( '*** error: not enough cpu time available for %s.' %
755 self.name, 'Using cfs scheduler for subprocess\n' )
756 return Host.popen( self, *args, mncmd=mncmd, **kwargs )
757
758 def cleanup( self ):
759 "Clean up Node, then clean up our cgroup"

Callers

nothing calls this directly

Calls 2

cgroupGetMethod · 0.95
popenMethod · 0.45

Tested by

no test coverage detected