当前位置: 首页>>代码示例>>Python>>正文


Python Node.__init__方法代码示例

本文整理汇总了Python中mininet.node.Node.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Node.__init__方法的具体用法?Python Node.__init__怎么用?Python Node.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mininet.node.Node的用法示例。


在下文中一共展示了Node.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import __init__ [as 别名]
    def __init__(self, name, inMountNamespace=False, inPIDNamespace=False,
                 inUTSNamespace=False, **params):
        """name: name of node
           inNamespace: in network namespace?
           inMountNamespace: has private mountspace?
           inPIDNamespace: has private PID namespace?
           params: Node parameters (see config() for details)"""

        # PID and Mount Namespace handling
        self.inPIDNamespace = inPIDNamespace
        self.inUTSNamespace = inUTSNamespace
        self.inMountNamespace = inMountNamespace

        # Private config monitoring
        self.hasPrivateLogs = False
        self.hasPrivateRun = False

        # Sanity check on namespace config
        if self.inPIDNamespace is True and self.inMountNamespace is False:
            raise Exception('PID namespaces require mount namespace for /proc')

        # Stash extended configuration information
        self.services = {}  # dict of services and parameters for this node
        self.privateMounts = {}  # dict of private mounts for this node

        # Network information
        self.loIntfs = {}

        # Request initialization of the BaseNode
        BaseNode.__init__(self, name, **params)
开发者ID:USC-NSL,项目名称:miniNExT,代码行数:32,代码来源:node.py

示例2: __init__

# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import __init__ [as 别名]
 def __init__(self, name, image=None, port_map=None, fs_map=None, **kwargs):
     if image is None:
         raise UnboundLocalError('Docker image is not specified')
     img_id = subprocess.check_output(['docker', 'images', '-q', image])
     if not img_id:
         raise ValueError('Docker image "%s" does not exist' % image)
     self.docker_image = image
     self.port_map = port_map
     self.fs_map = fs_map
     kwargs['inNamespace'] = True
     Node.__init__(self, name, **kwargs)
开发者ID:p4lang,项目名称:ntf,代码行数:13,代码来源:docker_node.py

示例3: __init__

# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import __init__ [as 别名]
    def __init__( self, name, sw_path = "dc_full",
		  dpid=None,
		  opts='',
                  thrift_port = None,
                  pcap_dump = False,
                  verbose = False, **kwargs ):
        Node.__init__( self, name, **kwargs )
        self.dpid = self.defaultDpid(dpid)
	self.opts = opts
	self.sw_path = sw_path
        self.verbose = verbose
        logfile = '/tmp/p4ns.%s.log' % self.name
        self.output = open(logfile, 'w')
        self.thrift_port = thrift_port
        self.pcap_dump = pcap_dump
开发者ID:holidayfun,项目名称:bfr,代码行数:17,代码来源:bier_demo.py

示例4: __init__

# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import __init__ [as 别名]
	def __init__(self, name, *args, **kwargs ):
		Node.__init__( self, name, inNamespace=False, *args, **kwargs )
		self.brname = "br-dreamer"
		self.OF_V = "OpenFlow13"
开发者ID:netgroup,项目名称:Dreamer-Management-Scripts,代码行数:6,代码来源:nodes.py

示例5: __init__

# 需要导入模块: from mininet.node import Node [as 别名]
# 或者: from mininet.node.Node import __init__ [as 别名]
 def __init__(self, name, inNamespace=True, **params):
     Node.__init__(self, name, inNamespace, **params)
开发者ID:fredericoschardong,项目名称:escape,代码行数:4,代码来源:CustomNetworkElements.py


注:本文中的mininet.node.Node.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。