From 9ac5b864318c62b699e85f6265846cd68094e4ae Mon Sep 17 00:00:00 2001 From: grossmj Date: Thu, 3 Jul 2014 09:02:25 -0600 Subject: [PATCH] Fixes IOU and VPCS renaming issues. --- gns3server/modules/dynamips/backends/vm.py | 4 ++-- gns3server/modules/iou/iou_device.py | 12 ------------ gns3server/modules/vpcs/vpcs_device.py | 12 ------------ 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/gns3server/modules/dynamips/backends/vm.py b/gns3server/modules/dynamips/backends/vm.py index 04e5fb75..f1989e98 100644 --- a/gns3server/modules/dynamips/backends/vm.py +++ b/gns3server/modules/dynamips/backends/vm.py @@ -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)) diff --git a/gns3server/modules/iou/iou_device.py b/gns3server/modules/iou/iou_device.py index ece451be..287e0c11 100644 --- a/gns3server/modules/iou/iou_device.py +++ b/gns3server/modules/iou/iou_device.py @@ -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") diff --git a/gns3server/modules/vpcs/vpcs_device.py b/gns3server/modules/vpcs/vpcs_device.py index 9c7957a8..5569c5d5 100644 --- a/gns3server/modules/vpcs/vpcs_device.py +++ b/gns3server/modules/vpcs/vpcs_device.py @@ -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")