diff --git a/gns3server/compute/dynamips/nodes/ethernet_switch.py b/gns3server/compute/dynamips/nodes/ethernet_switch.py index 9b936cbd..62baecb7 100644 --- a/gns3server/compute/dynamips/nodes/ethernet_switch.py +++ b/gns3server/compute/dynamips/nodes/ethernet_switch.py @@ -79,7 +79,7 @@ class EthernetSwitch(Device): :param hypervisor: Dynamips hypervisor instance """ - def __init__(self, name, node_id, project, manager, console=None, console_type="telnet", 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) self._nios = {} @@ -131,6 +131,10 @@ class EthernetSwitch(Device): @console_type.setter def console_type(self, console_type): + + if console_type == "telnet": + self.project.emit("log.warning", { + "message": '"{name}": Telnet access for switches is not available in this version of GNS3'.format(name=self._name)}) self._console_type = console_type @property @@ -184,6 +188,8 @@ class EthernetSwitch(Device): # self._telnet_server = (await asyncio.start_server(self._telnet.run, self._manager.port_manager.console_host, self.console)) #except OSError as e: # self.project.emit("log.warning", {"message": "Could not start Telnet server on socket {}:{}: {}".format(self._manager.port_manager.console_host, self.console, e)}) + if self._console_type == "telnet": + self.project.emit("log.warning", {"message": '"{name}": Telnet access for switches is not available in this version of GNS3'.format(name=self._name)}) self._hypervisor.devices.append(self) async def set_name(self, new_name): diff --git a/gns3server/controller/template_manager.py b/gns3server/controller/template_manager.py index af647325..63239fde 100644 --- a/gns3server/controller/template_manager.py +++ b/gns3server/controller/template_manager.py @@ -63,7 +63,7 @@ class TemplateManager: builtins.append(Template(uuid.uuid3(uuid.NAMESPACE_DNS, "cloud"), {"template_type": "cloud", "name": "Cloud", "category": 2, "symbol": ":/symbols/cloud.svg"}, builtin=True)) builtins.append(Template(uuid.uuid3(uuid.NAMESPACE_DNS, "nat"), {"template_type": "nat", "name": "NAT", "category": 2, "symbol": ":/symbols/cloud.svg"}, builtin=True)) builtins.append(Template(uuid.uuid3(uuid.NAMESPACE_DNS, "vpcs"), {"template_type": "vpcs", "name": "VPCS", "default_name_format": "PC-{0}", "category": 2, "symbol": ":/symbols/vpcs_guest.svg", "properties": {"base_script_file": "vpcs_base_config.txt"}}, builtin=True)) - builtins.append(Template(uuid.uuid3(uuid.NAMESPACE_DNS, "ethernet_switch"), {"template_type": "ethernet_switch", "console_type": "telnet", "name": "Ethernet switch", "category": 1, "symbol": ":/symbols/ethernet_switch.svg"}, builtin=True)) + builtins.append(Template(uuid.uuid3(uuid.NAMESPACE_DNS, "ethernet_switch"), {"template_type": "ethernet_switch", "console_type": "none", "name": "Ethernet switch", "category": 1, "symbol": ":/symbols/ethernet_switch.svg"}, builtin=True)) builtins.append(Template(uuid.uuid3(uuid.NAMESPACE_DNS, "ethernet_hub"), {"template_type": "ethernet_hub", "name": "Ethernet hub", "category": 1, "symbol": ":/symbols/hub.svg"}, builtin=True)) builtins.append(Template(uuid.uuid3(uuid.NAMESPACE_DNS, "frame_relay_switch"), {"template_type": "frame_relay_switch", "name": "Frame Relay switch", "category": 1, "symbol": ":/symbols/frame_relay_switch.svg"}, builtin=True)) builtins.append(Template(uuid.uuid3(uuid.NAMESPACE_DNS, "atm_switch"), {"template_type": "atm_switch", "name": "ATM switch", "category": 1, "symbol": ":/symbols/atm_switch.svg"}, builtin=True)) diff --git a/gns3server/schemas/ethernet_switch_template.py b/gns3server/schemas/ethernet_switch_template.py index 27de7012..e2473220 100644 --- a/gns3server/schemas/ethernet_switch_template.py +++ b/gns3server/schemas/ethernet_switch_template.py @@ -109,7 +109,7 @@ ETHERNET_SWITCH_TEMPLATE_PROPERTIES = { "console_type": { "description": "Console type", "enum": ["telnet", "none"], - "default": "telnet" + "default": "none" }, }