mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-01 04:38:12 +00:00
Fixes IOU and VPCS renaming issues.
This commit is contained in:
parent
329891fc83
commit
9ac5b86431
@ -409,7 +409,7 @@ class VM(object):
|
||||
router.set_config(request["startup_config"])
|
||||
else:
|
||||
router.set_config(request["startup_config"])
|
||||
response["startup_config"] = request["startup_config"]
|
||||
response["startup_config"] = request["startup_config"]
|
||||
|
||||
if "private_config" in request:
|
||||
if os.path.isfile(request["private_config"]) and request["private_config"] != private_config_path:
|
||||
@ -418,7 +418,7 @@ class VM(object):
|
||||
router.set_config(router.startup_config, request["private_config"])
|
||||
else:
|
||||
router.set_config(router.startup_config, request["private_config"])
|
||||
response["private_config"] = request["private_config"]
|
||||
response["private_config"] = request["private_config"]
|
||||
|
||||
except DynamipsError as e:
|
||||
self.send_custom_error(str(e))
|
||||
|
@ -196,18 +196,6 @@ class IOUDevice(object):
|
||||
:param new_name: name
|
||||
"""
|
||||
|
||||
if self._started:
|
||||
raise IOUError("Cannot change the name to {} while the device is running".format(new_name))
|
||||
|
||||
new_working_dir = os.path.join(os.path.dirname(self._working_dir), new_name)
|
||||
try:
|
||||
shutil.move(self._working_dir, new_working_dir)
|
||||
self._working_dir = new_working_dir
|
||||
except OSError as e:
|
||||
raise IOUError("Could not move working directory from {} to {}: {}".format(self._working_dir,
|
||||
new_working_dir,
|
||||
e))
|
||||
|
||||
if self._initial_config:
|
||||
# update the initial-config
|
||||
config_path = os.path.join(self._working_dir, "initial-config.cfg")
|
||||
|
@ -177,18 +177,6 @@ class VPCSDevice(object):
|
||||
:param new_name: name
|
||||
"""
|
||||
|
||||
if self._started:
|
||||
raise VPCSError("Cannot change the name to {} while the device is running".format(new_name))
|
||||
|
||||
new_working_dir = os.path.join(os.path.dirname(self._working_dir), new_name)
|
||||
try:
|
||||
shutil.move(self._working_dir, new_working_dir)
|
||||
self._working_dir = new_working_dir
|
||||
except OSError as e:
|
||||
raise VPCSError("Could not move working directory from {} to {}: {}".format(self._working_dir,
|
||||
new_working_dir,
|
||||
e))
|
||||
|
||||
if self._script_file:
|
||||
# update the startup.vpc
|
||||
config_path = os.path.join(self._working_dir, "startup.vpc")
|
||||
|
Loading…
Reference in New Issue
Block a user