mirror of
https://github.com/GNS3/gns3-server.git
synced 2024-12-28 00:28:54 +00:00
Do not crash if you pass {name} in name
This commit is contained in:
parent
96194cef67
commit
959c08449e
@ -289,7 +289,7 @@ class Project:
|
|||||||
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
|
||||||
for number in range(1, 1000000):
|
for number in range(1, 1000000):
|
||||||
name = base_name.format(number, id=number)
|
name = base_name.format(number, id=number, name="Node")
|
||||||
if name not in self._allocated_node_names:
|
if name not in self._allocated_node_names:
|
||||||
self._allocated_node_names.add(name)
|
self._allocated_node_names.add(name)
|
||||||
return name
|
return name
|
||||||
|
Loading…
Reference in New Issue
Block a user