mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-28 11:18:11 +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"])
|
router.set_config(request["startup_config"])
|
||||||
else:
|
else:
|
||||||
router.set_config(request["startup_config"])
|
router.set_config(request["startup_config"])
|
||||||
response["startup_config"] = request["startup_config"]
|
response["startup_config"] = request["startup_config"]
|
||||||
|
|
||||||
if "private_config" in request:
|
if "private_config" in request:
|
||||||
if os.path.isfile(request["private_config"]) and request["private_config"] != private_config_path:
|
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"])
|
router.set_config(router.startup_config, request["private_config"])
|
||||||
else:
|
else:
|
||||||
router.set_config(router.startup_config, request["private_config"])
|
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:
|
except DynamipsError as e:
|
||||||
self.send_custom_error(str(e))
|
self.send_custom_error(str(e))
|
||||||
|
@ -196,18 +196,6 @@ class IOUDevice(object):
|
|||||||
:param new_name: name
|
: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:
|
if self._initial_config:
|
||||||
# update the initial-config
|
# update the initial-config
|
||||||
config_path = os.path.join(self._working_dir, "initial-config.cfg")
|
config_path = os.path.join(self._working_dir, "initial-config.cfg")
|
||||||
|
@ -177,18 +177,6 @@ class VPCSDevice(object):
|
|||||||
:param new_name: name
|
: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:
|
if self._script_file:
|
||||||
# update the startup.vpc
|
# update the startup.vpc
|
||||||
config_path = os.path.join(self._working_dir, "startup.vpc")
|
config_path = os.path.join(self._working_dir, "startup.vpc")
|
||||||
|
Loading…
Reference in New Issue
Block a user