From c43960fbfd3d5fb8694634d5442ad03bd2179a5b Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 22 Sep 2015 13:45:10 +0200 Subject: [PATCH 1/3] Clarify error message when we got UTF-8 chars in the iourc file Fix #307 --- gns3server/modules/iou/iou_vm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/modules/iou/iou_vm.py b/gns3server/modules/iou/iou_vm.py index 8a3d55d8..9237dcaf 100644 --- a/gns3server/modules/iou/iou_vm.py +++ b/gns3server/modules/iou/iou_vm.py @@ -385,7 +385,7 @@ class IOUVM(BaseVM): except configparser.Error as e: raise IOUError("Could not parse iourc file {}: {}".format(self.iourc_path, e)) except UnicodeDecodeError as e: - raise IOUError("Invalid iourc file {}: {}".format(self.iourc_path, e)) + raise IOUError("Non ascii characters in iourc file {}, please remove them: {}".format(self.iourc_path, e)) if "license" not in config: raise IOUError("License section not found in iourc file {}".format(self.iourc_path)) hostname = socket.gethostname() From bfe3b12342b3b5ae47d4dbfd2722eb67523b4345 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 22 Sep 2015 14:39:21 +0200 Subject: [PATCH 2/3] Fix dynamips configuration lost when you delete a node Fix #316 --- gns3server/modules/dynamips/nodes/router.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gns3server/modules/dynamips/nodes/router.py b/gns3server/modules/dynamips/nodes/router.py index 5d8331e3..cf6dec6d 100644 --- a/gns3server/modules/dynamips/nodes/router.py +++ b/gns3server/modules/dynamips/nodes/router.py @@ -318,8 +318,6 @@ class Router(BaseVM): return log.debug('Router "{name}" [{id}] is closing'.format(name=self._name, id=self._id)) - if self._dynamips_id in self._dynamips_ids[self._project.id]: - self._dynamips_ids[self._project.id].remove(self._dynamips_id) if self._console: self._manager.port_manager.release_tcp_port(self._console, self._project) @@ -1608,6 +1606,9 @@ class Router(BaseVM): log.warn("Could not delete file {}: {}".format(file, e)) continue + if self._dynamips_id in self._dynamips_ids[self._project.id]: + self._dynamips_ids[self._project.id].remove(self._dynamips_id) + @asyncio.coroutine def clean_delete(self): """ From 09aa31fb438c441501b2bfba86c2cc87678da909 Mon Sep 17 00:00:00 2001 From: grossmj Date: Wed, 16 Sep 2015 06:09:14 -0600 Subject: [PATCH 3/3] Do not automatically delete Dynamips bootflash file because they are necessary to restore VLANs on the c3600 platform. --- gns3server/modules/dynamips/__init__.py | 2 -- gns3server/modules/dynamips/nodes/router.py | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/modules/dynamips/__init__.py b/gns3server/modules/dynamips/__init__.py index c8b3d953..bc888b23 100644 --- a/gns3server/modules/dynamips/__init__.py +++ b/gns3server/modules/dynamips/__init__.py @@ -172,9 +172,7 @@ class Dynamips(BaseManager): files += glob.glob(os.path.join(project_dir, "*_lock")) files += glob.glob(os.path.join(project_dir, "ilt_*")) files += glob.glob(os.path.join(project_dir, "c[0-9][0-9][0-9][0-9]_i[0-9]*_rommon_vars")) - files += glob.glob(os.path.join(project_dir, "c[0-9][0-9][0-9][0-9]_i[0-9]*_ssa")) files += glob.glob(os.path.join(project_dir, "c[0-9][0-9][0-9][0-9]_i[0-9]*_log.txt")) - files += glob.glob(os.path.join(project_dir, "c[0-9][0-9][0-9][0-9]_i[0-9]*_bootflash")) for file in files: try: log.debug("Deleting file {}".format(file)) diff --git a/gns3server/modules/dynamips/nodes/router.py b/gns3server/modules/dynamips/nodes/router.py index cf6dec6d..bf25b6a6 100644 --- a/gns3server/modules/dynamips/nodes/router.py +++ b/gns3server/modules/dynamips/nodes/router.py @@ -352,6 +352,8 @@ class Router(BaseVM): files += glob.glob(os.path.join(project_dir, "{}_i{}_nvram".format(self.platform, self.dynamips_id))) files += glob.glob(os.path.join(project_dir, "{}_i{}_flash[0-1]".format(self.platform, self.dynamips_id))) files += glob.glob(os.path.join(project_dir, "{}_i{}_rom".format(self.platform, self.dynamips_id))) + files += glob.glob(os.path.join(project_dir, "{}_i{}_bootflash".format(self.platform, self.dynamips_id))) + files += glob.glob(os.path.join(project_dir, "{}_i{}_ssa").format(self.platform, self.dynamips_id)) for file in files: try: log.debug("Deleting file {}".format(file))