mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-25 16:28:11 +00:00
Fix the initial startup for VPCS is not used
The default VPCS template didn't provide the base startup config setting. This prevent the replacement of the hostname in the configuration file. Fix https://github.com/GNS3/gns3-gui/issues/2123
This commit is contained in:
parent
a7170da93f
commit
617868402f
@ -116,7 +116,7 @@ class Controller:
|
|||||||
builtins = []
|
builtins = []
|
||||||
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "cloud"), {"node_type": "cloud", "name": "Cloud", "category": 2, "symbol": ":/symbols/cloud.svg"}, builtin=True))
|
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "cloud"), {"node_type": "cloud", "name": "Cloud", "category": 2, "symbol": ":/symbols/cloud.svg"}, builtin=True))
|
||||||
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "nat"), {"node_type": "nat", "name": "NAT", "category": 2, "symbol": ":/symbols/cloud.svg"}, builtin=True))
|
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "nat"), {"node_type": "nat", "name": "NAT", "category": 2, "symbol": ":/symbols/cloud.svg"}, builtin=True))
|
||||||
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "vpcs"), {"node_type": "vpcs", "name": "VPCS", "category": 2, "symbol": ":/symbols/vpcs_guest.svg"}, builtin=True))
|
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "vpcs"), {"node_type": "vpcs", "name": "VPCS", "category": 2, "symbol": ":/symbols/vpcs_guest.svg", "properties": {"base_script_file": "vpcs_base_config.txt"}}, builtin=True))
|
||||||
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "ethernet_switch"), {"node_type": "ethernet_switch", "name": "Ethernet switch", "category": 1, "symbol": ":/symbols/ethernet_switch.svg"}, builtin=True))
|
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "ethernet_switch"), {"node_type": "ethernet_switch", "name": "Ethernet switch", "category": 1, "symbol": ":/symbols/ethernet_switch.svg"}, builtin=True))
|
||||||
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "ethernet_hub"), {"node_type": "ethernet_hub", "name": "Ethernet hub", "category": 1, "symbol": ":/symbols/hub.svg"}, builtin=True))
|
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "ethernet_hub"), {"node_type": "ethernet_hub", "name": "Ethernet hub", "category": 1, "symbol": ":/symbols/hub.svg"}, builtin=True))
|
||||||
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "frame_relay_switch"), {"node_type": "frame_relay_switch", "name": "Frame Relay switch", "category": 1, "symbol": ":/symbols/frame_relay_switch.svg"}, builtin=True))
|
builtins.append(Appliance(uuid.uuid3(uuid.NAMESPACE_DNS, "frame_relay_switch"), {"node_type": "frame_relay_switch", "name": "Frame Relay switch", "category": 1, "symbol": ":/symbols/frame_relay_switch.svg"}, builtin=True))
|
||||||
|
@ -483,6 +483,7 @@ def test_load_base_files(controller, config, tmpdir):
|
|||||||
def test_appliance_templates(controller, async_run):
|
def test_appliance_templates(controller, async_run):
|
||||||
controller.load_appliances()
|
controller.load_appliances()
|
||||||
assert len(controller.appliance_templates) > 0
|
assert len(controller.appliance_templates) > 0
|
||||||
|
assert "Alpine Linux" in [c.__json__()["name"] for c in controller.appliance_templates.values()]
|
||||||
|
|
||||||
|
|
||||||
def test_load_appliances(controller):
|
def test_load_appliances(controller):
|
||||||
@ -498,6 +499,11 @@ def test_load_appliances(controller):
|
|||||||
controller.load_appliances()
|
controller.load_appliances()
|
||||||
assert "Test" in [appliance.name for appliance in controller.appliances.values()]
|
assert "Test" in [appliance.name for appliance in controller.appliances.values()]
|
||||||
assert "Cloud" in [appliance.name for appliance in controller.appliances.values()]
|
assert "Cloud" in [appliance.name for appliance in controller.appliances.values()]
|
||||||
|
assert "VPCS" in [appliance.name for appliance in controller.appliances.values()]
|
||||||
|
|
||||||
|
for appliance in controller.appliances.values():
|
||||||
|
if appliance.name == "VPCS":
|
||||||
|
assert appliance._data["properties"] == {"base_script_file": "vpcs_base_config.txt"}
|
||||||
|
|
||||||
# UUID should not change when you run again the function
|
# UUID should not change when you run again the function
|
||||||
for appliance in controller.appliances.values():
|
for appliance in controller.appliances.values():
|
||||||
|
Loading…
Reference in New Issue
Block a user