mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +00:00
parent
fc6b6b5e63
commit
283b08c2a1
@ -368,7 +368,8 @@ class Project:
|
|||||||
if base_name is None:
|
if base_name is None:
|
||||||
return None
|
return None
|
||||||
base_name = re.sub(r"[ ]", "", base_name)
|
base_name = re.sub(r"[ ]", "", base_name)
|
||||||
base_name = re.sub(r"[0-9]+$", "{0}", base_name)
|
if base_name in self._allocated_node_names:
|
||||||
|
base_name = re.sub(r"[0-9]+$", "{0}", base_name)
|
||||||
|
|
||||||
if '{0}' in base_name or '{id}' in base_name:
|
if '{0}' in base_name or '{id}' in base_name:
|
||||||
# base name is a template, replace {0} or {id} by an unique identifier
|
# base name is a template, replace {0} or {id} by an unique identifier
|
||||||
|
@ -602,6 +602,9 @@ def test_node_name(project, async_run):
|
|||||||
node = async_run(project.add_node(compute, "VPCS-1", None, node_type="vpcs", properties={"startup_config": "test.cfg"}))
|
node = async_run(project.add_node(compute, "VPCS-1", None, node_type="vpcs", properties={"startup_config": "test.cfg"}))
|
||||||
assert node.name == "VPCS-2"
|
assert node.name == "VPCS-2"
|
||||||
|
|
||||||
|
node = async_run(project.add_node(compute, "R3", None, node_type="vpcs", properties={"startup_config": "test.cfg"}))
|
||||||
|
assert node.name == "R3"
|
||||||
|
|
||||||
|
|
||||||
def test_add_iou_node_and_check_if_gets_application_id(project, async_run):
|
def test_add_iou_node_and_check_if_gets_application_id(project, async_run):
|
||||||
compute = MagicMock()
|
compute = MagicMock()
|
||||||
|
Loading…
Reference in New Issue
Block a user