mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Revert "Backport auxiliary console support for Qemu, Docker and Dynamips nodes"
This commit is contained in:
1 parent
f1294cf267
commit
af6f34b2ca
25 files changed
+156
-390
No files matched your search
@@ -40,17 +40,15 @@ class C1700(Router):
|
||||
:param manager: Parent VM Manager
|
||||
:param dynamips_id: ID to use with Dynamips
|
||||
:param console: console port
|
||||
:param console_type: console type
|
||||
:param aux: auxiliary console port
|
||||
:param aux_type: auxiliary console type
|
||||
:param chassis: chassis for this router:
|
||||
1720, 1721, 1750, 1751 or 1760 (default = 1720).
|
||||
1710 is not supported.
|
||||
"""
|
||||
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, aux_type="none", chassis="1720"):
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, chassis="1720"):
|
||||
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, aux_type, platform="c1700")
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, platform="c1700")
|
||||
|
||||
# Set default values for this platform (must be the same as Dynamips)
|
||||
self._ram = 64
|
||||
|
||||
@@ -42,9 +42,7 @@ class C2600(Router):
|
||||
:param manager: Parent VM Manager
|
||||
:param dynamips_id: ID to use with Dynamips
|
||||
:param console: console port
|
||||
:param console_type: console type
|
||||
:param aux: auxiliary console port
|
||||
:param aux_type: auxiliary console type
|
||||
:param chassis: chassis for this router:
|
||||
2610, 2611, 2620, 2621, 2610XM, 2611XM
|
||||
2620XM, 2621XM, 2650XM or 2651XM (default = 2610).
|
||||
@@ -63,9 +61,9 @@ class C2600(Router):
|
||||
"2650XM": C2600_MB_1FE,
|
||||
"2651XM": C2600_MB_2FE}
|
||||
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, aux_type="none", chassis="2610"):
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, chassis="2610"):
|
||||
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, aux_type, platform="c2600")
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, platform="c2600")
|
||||
|
||||
# Set default values for this platform (must be the same as Dynamips)
|
||||
self._ram = 64
|
||||
|
||||
@@ -40,14 +40,12 @@ class C2691(Router):
|
||||
:param manager: Parent VM Manager
|
||||
:param dynamips_id: ID to use with Dynamips
|
||||
:param console: console port
|
||||
:param console_type: console type
|
||||
:param aux: auxiliary console port
|
||||
:param aux_type: auxiliary console type
|
||||
"""
|
||||
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, aux_type="none", chassis=None):
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, chassis=None):
|
||||
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, aux_type, platform="c2691")
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, platform="c2691")
|
||||
|
||||
# Set default values for this platform (must be the same as Dynamips)
|
||||
self._ram = 128
|
||||
|
||||
@@ -39,16 +39,14 @@ class C3600(Router):
|
||||
:param manager: Parent VM Manager
|
||||
:param dynamips_id: ID to use with Dynamips
|
||||
:param console: console port
|
||||
:param console_type: console type
|
||||
:param aux: auxiliary console port
|
||||
:param aux_type: auxiliary console type
|
||||
:param chassis: chassis for this router:
|
||||
3620, 3640 or 3660 (default = 3640).
|
||||
"""
|
||||
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, aux_type="none", chassis="3640"):
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, chassis="3640"):
|
||||
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, aux_type, platform="c3600")
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, platform="c3600")
|
||||
|
||||
# Set default values for this platform (must be the same as Dynamips)
|
||||
self._ram = 128
|
||||
|
||||
@@ -40,14 +40,12 @@ class C3725(Router):
|
||||
:param manager: Parent VM Manager
|
||||
:param dynamips_id: ID to use with Dynamips
|
||||
:param console: console port
|
||||
:param console_type: console type
|
||||
:param aux: auxiliary console port
|
||||
:param aux_type: auxiliary console type
|
||||
"""
|
||||
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, aux_type="none", chassis=None):
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, chassis=None):
|
||||
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, aux_type, platform="c3725")
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, platform="c3725")
|
||||
|
||||
# Set default values for this platform (must be the same as Dynamips)
|
||||
self._ram = 128
|
||||
|
||||
@@ -40,14 +40,12 @@ class C3745(Router):
|
||||
:param manager: Parent VM Manager
|
||||
:param dynamips_id: ID to use with Dynamips
|
||||
:param console: console port
|
||||
:param console_type: console type
|
||||
:param aux: auxiliary console port
|
||||
:param aux_type: auxiliary console type
|
||||
"""
|
||||
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, aux_type="none", chassis=None):
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, chassis=None):
|
||||
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, aux_type, platform="c3745")
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, platform="c3745")
|
||||
|
||||
# Set default values for this platform (must be the same as Dynamips)
|
||||
self._ram = 128
|
||||
|
||||
@@ -42,15 +42,13 @@ class C7200(Router):
|
||||
:param manager: Parent VM Manager
|
||||
:param dynamips_id: ID to use with Dynamips
|
||||
:param console: console port
|
||||
:param console_type: console type
|
||||
:param aux: auxiliary console port
|
||||
:param aux_type: auxiliary console type
|
||||
:param npe: Default NPE
|
||||
"""
|
||||
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, aux_type="none", npe="npe-400", chassis=None):
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id, console=None, console_type="telnet", aux=None, npe="npe-400", chassis=None):
|
||||
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, aux_type, platform="c7200")
|
||||
super().__init__(name, node_id, project, manager, dynamips_id, console, console_type, aux, platform="c7200")
|
||||
|
||||
# Set default values for this platform (must be the same as Dynamips)
|
||||
self._ram = 256
|
||||
|
||||
@@ -52,9 +52,7 @@ class Router(BaseNode):
|
||||
:param manager: Parent VM Manager
|
||||
:param dynamips_id: ID to use with Dynamips
|
||||
:param console: console port
|
||||
:param console_type: console type
|
||||
:param aux: auxiliary console port
|
||||
:param aux_type: auxiliary console type
|
||||
:param platform: Platform of this router
|
||||
"""
|
||||
|
||||
@@ -63,9 +61,9 @@ class Router(BaseNode):
|
||||
2: "running",
|
||||
3: "suspended"}
|
||||
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id=None, console=None, console_type="telnet", aux=None, aux_type="none", platform="c7200", hypervisor=None, ghost_flag=False):
|
||||
def __init__(self, name, node_id, project, manager, dynamips_id=None, console=None, console_type="telnet", aux=None, platform="c7200", hypervisor=None, ghost_flag=False):
|
||||
|
||||
super().__init__(name, node_id, project, manager, console=console, console_type=console_type, aux=aux, aux_type=aux_type)
|
||||
super().__init__(name, node_id, project, manager, console=console, console_type=console_type, aux=aux, allocate_aux=aux)
|
||||
|
||||
self._working_directory = os.path.join(self.project.module_working_directory(self.manager.module_name.lower()), self.id)
|
||||
try:
|
||||
@@ -168,7 +166,6 @@ class Router(BaseNode):
|
||||
"console": self.console,
|
||||
"console_type": self.console_type,
|
||||
"aux": self.aux,
|
||||
"aux_type": self.aux_type,
|
||||
"mac_addr": self._mac_addr,
|
||||
"system_id": self._system_id}
|
||||
|
||||
@@ -226,14 +223,15 @@ class Router(BaseNode):
|
||||
platform=self._platform,
|
||||
id=self._id))
|
||||
|
||||
if self._console is not None:
|
||||
if self._console:
|
||||
await self._hypervisor.send('vm set_con_tcp_port "{name}" {console}'.format(name=self._name, console=self._console))
|
||||
|
||||
if self.aux is not None:
|
||||
await self._hypervisor.send('vm set_aux_tcp_port "{name}" {aux}'.format(name=self._name, aux=self.aux))
|
||||
|
||||
# get the default base MAC address
|
||||
mac_addr = await self._hypervisor.send('{platform} get_mac_addr "{name}"'.format(platform=self._platform, name=self._name))
|
||||
mac_addr = await self._hypervisor.send('{platform} get_mac_addr "{name}"'.format(platform=self._platform,
|
||||
name=self._name))
|
||||
self._mac_addr = mac_addr[0]
|
||||
|
||||
self._hypervisor.devices.append(self)
|
||||
@@ -992,27 +990,7 @@ class Router(BaseNode):
|
||||
"""
|
||||
|
||||
self.aux = aux
|
||||
await self._hypervisor.send('vm set_aux_tcp_port "{name}" {aux}'.format(name=self._name, aux=self._aux))
|
||||
|
||||
async def set_aux_type(self, aux_type):
|
||||
"""
|
||||
Sets the aux type.
|
||||
|
||||
:param aux_type: auxiliary console type
|
||||
"""
|
||||
|
||||
if self.aux_type != aux_type:
|
||||
status = await self.get_status()
|
||||
if status == "running":
|
||||
raise DynamipsError('"{name}" must be stopped to change the auxiliary console type to {aux_type}'.format(
|
||||
name=self._name,
|
||||
aux_type=aux_type)
|
||||
)
|
||||
|
||||
self.aux_type = aux_type
|
||||
|
||||
if self._aux and aux_type == "telnet":
|
||||
await self._hypervisor.send('vm set_aux_tcp_port "{name}" {aux}'.format(name=self._name, aux=self._aux))
|
||||
await self._hypervisor.send('vm set_aux_tcp_port "{name}" {aux}'.format(name=self._name, aux=aux))
|
||||
|
||||
async def reset_console(self):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user