Disallow to rename a running node. Fixes https://github.com/GNS3/gns3-gui/issues/2499

This commit is contained in:
grossmj committed 2020-07-27 15:06:17 +09:30
1 parent 831ee5f468
commit 12732aaf83
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -401,8 +401,8 @@ class Node:
if prop == "properties":
compute_properties = kwargs[prop]
else:
if prop == "name" and self.node_type == "dynamips" and self.status == "started":
raise aiohttp.web.HTTPConflict(text="Sorry, it is not possible rename of a Dynamips node that is already powered on")
if prop == "name" and self.status == "started" and self._node_type not in ("cloud", "nat", "ethernet_switch", "ethernet_hub", "frame_relay_switch", "atm_switch"):
raise aiohttp.web.HTTPConflict(text="Sorry, it is not possible to rename a node that is already powered on")
setattr(self, prop, kwargs[prop])
if compute_properties and "custom_adapters" in compute_properties: