本文整理汇总了Python中gns3.ports.ethernet_port.EthernetPort.setHotPluggable方法的典型用法代码示例。如果您正苦于以下问题:Python EthernetPort.setHotPluggable方法的具体用法?Python EthernetPort.setHotPluggable怎么用?Python EthernetPort.setHotPluggable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gns3.ports.ethernet_port.EthernetPort
的用法示例。
在下文中一共展示了EthernetPort.setHotPluggable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _addAdapters
# 需要导入模块: from gns3.ports.ethernet_port import EthernetPort [as 别名]
# 或者: from gns3.ports.ethernet_port.EthernetPort import setHotPluggable [as 别名]
def _addAdapters(self, adapters):
"""
Adds adapters.
:param adapters: number of adapters
"""
interface_number = segment_number = 0
for adapter_number in range(0, adapters):
if self._first_port_name and adapter_number == 0:
port_name = self._first_port_name
else:
port_name = self._port_name_format.format(
interface_number,
segment_number,
port0=interface_number,
port1=1 + interface_number,
segment0=segment_number,
segment1=1 + segment_number
)
interface_number += 1
if self._port_segment_size and interface_number % self._port_segment_size == 0:
segment_number += 1
interface_number = 0
new_port = EthernetPort(port_name)
new_port.setAdapterNumber(adapter_number)
new_port.setPortNumber(0)
new_port.setHotPluggable(False)
self._ports.append(new_port)
log.debug("Adapter {} with port {} has been added".format(adapter_number, port_name))
示例2: _addAdapters
# 需要导入模块: from gns3.ports.ethernet_port import EthernetPort [as 别名]
# 或者: from gns3.ports.ethernet_port.EthernetPort import setHotPluggable [as 别名]
def _addAdapters(self, adapters):
"""Adds adapters.
:param adapters: number of adapters
"""
for adapter_number in range(0, adapters):
adapter_name = "eth" + str(adapter_number)
short_name = EthernetPort.shortNameType() + str(adapter_number)
new_port = EthernetPort(adapter_name)
new_port.setShortName(short_name)
new_port.setAdapterNumber(adapter_number)
new_port.setPortNumber(0)
new_port.setHotPluggable(False)
new_port.setPacketCaptureSupported(True)
self._ports.append(new_port)
log.debug("Adapter {} has been added".format(adapter_name))
示例3: __init__
# 需要导入模块: from gns3.ports.ethernet_port import EthernetPort [as 别名]
# 或者: from gns3.ports.ethernet_port.EthernetPort import setHotPluggable [as 别名]
def __init__(self, module, server, project):
super().__init__(module, server, project)
log.info("VPCS instance is being created")
self._vm_id = None
self._settings = {"name": "",
"startup_script": None,
"startup_script_path": None,
"console": None}
port_name = EthernetPort.longNameType() + str(0)
short_name = EthernetPort.shortNameType() + str(0)
# VPCS devices have only one fixed Ethernet port
port = EthernetPort(port_name)
port.setShortName(short_name)
port.setAdapterNumber(0)
port.setPortNumber(0)
port.setHotPluggable(False)
self._ports.append(port)
log.debug("port {} has been added".format(port_name))