1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-12 19:38:57 +00:00

Fix an issue with some node name format

Fix #922
This commit is contained in:
Julien Duponchelle 2017-02-28 18:03:10 +01:00
parent 7e1e63cd09
commit e828c9068a
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -293,7 +293,7 @@ class Project:
name = base_name.format(number, id=number, name="Node")
except KeyError as e:
raise aiohttp.web.HTTPConflict(text="{" + e.args[0] + "} is not a valid replacement string in the node name")
except ValueError as e:
except (ValueError, IndexError) as e:
raise aiohttp.web.HTTPConflict(text="{} is not a valid replacement string in the node name".format(base_name))
if name not in self._allocated_node_names:
self._allocated_node_names.add(name)