mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-26 08:48:11 +00:00
Fix console type error when creating Ethernet switch node. Fixes #1873
This commit is contained in:
parent
11c53c128e
commit
8cce0eedee
@ -79,7 +79,7 @@ class EthernetSwitch(Device):
|
|||||||
:param hypervisor: Dynamips hypervisor instance
|
:param hypervisor: Dynamips hypervisor instance
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, name, node_id, project, manager, console=None, console_type="none", ports=None, hypervisor=None):
|
def __init__(self, name, node_id, project, manager, console=None, console_type=None, ports=None, hypervisor=None):
|
||||||
|
|
||||||
super().__init__(name, node_id, project, manager, hypervisor)
|
super().__init__(name, node_id, project, manager, hypervisor)
|
||||||
self._nios = {}
|
self._nios = {}
|
||||||
@ -90,6 +90,9 @@ class EthernetSwitch(Device):
|
|||||||
self._console = console
|
self._console = console
|
||||||
self._console_type = console_type
|
self._console_type = console_type
|
||||||
|
|
||||||
|
if self._console_type is None:
|
||||||
|
self._console_type = "none"
|
||||||
|
|
||||||
if self._console is not None:
|
if self._console is not None:
|
||||||
self._console = self._manager.port_manager.reserve_tcp_port(self._console, self._project)
|
self._console = self._manager.port_manager.reserve_tcp_port(self._console, self._project)
|
||||||
else:
|
else:
|
||||||
@ -115,6 +118,7 @@ class EthernetSwitch(Device):
|
|||||||
"project_id": self.project.id,
|
"project_id": self.project.id,
|
||||||
"ports_mapping": self._ports,
|
"ports_mapping": self._ports,
|
||||||
"status": "started"}
|
"status": "started"}
|
||||||
|
|
||||||
return ethernet_switch_info
|
return ethernet_switch_info
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
Reference in New Issue
Block a user