From cf5af8a6f711c2a4ccc4c06ee3711fc6bd4563d0 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 25 Jul 2015 16:39:38 -0600 Subject: [PATCH 1/8] Fixes missing chipset info for VirtualBox VM (maybe some older VirtualBox version don't have it). Fixes #254. --- gns3server/modules/virtualbox/virtualbox_vm.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gns3server/modules/virtualbox/virtualbox_vm.py b/gns3server/modules/virtualbox/virtualbox_vm.py index 648eafd6..08a567fd 100644 --- a/gns3server/modules/virtualbox/virtualbox_vm.py +++ b/gns3server/modules/virtualbox/virtualbox_vm.py @@ -574,10 +574,11 @@ class VirtualBoxVM(BaseVM): # check the maximum number of adapters supported by the VM vm_info = yield from self._get_vm_info() - chipset = vm_info["chipset"] maximum_adapters = 8 - if chipset == "ich9": - maximum_adapters = int(self._system_properties["Maximum ICH9 Network Adapter count"]) + if "chipset" in vm_info: + chipset = vm_info["chipset"] + if chipset == "ich9": + maximum_adapters = int(self._system_properties["Maximum ICH9 Network Adapter count"]) return maximum_adapters def _get_pipe_name(self): From 7b001e4d36b8139178a4dca22828279561adee5d Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 25 Jul 2015 16:46:23 -0600 Subject: [PATCH 2/8] Catch GeneratorExit exception. Fixes #231. --- gns3server/modules/base_manager.py | 2 +- gns3server/modules/dynamips/__init__.py | 4 ++-- gns3server/modules/project.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gns3server/modules/base_manager.py b/gns3server/modules/base_manager.py index d210a9a0..056ad8fc 100644 --- a/gns3server/modules/base_manager.py +++ b/gns3server/modules/base_manager.py @@ -113,7 +113,7 @@ class BaseManager: for future in done: try: future.result() - except Exception as e: + except (Exception, GeneratorExit) as e: log.error("Could not close VM {}".format(e), exc_info=1) continue diff --git a/gns3server/modules/dynamips/__init__.py b/gns3server/modules/dynamips/__init__.py index 4be683e0..27431659 100644 --- a/gns3server/modules/dynamips/__init__.py +++ b/gns3server/modules/dynamips/__init__.py @@ -130,7 +130,7 @@ class Dynamips(BaseManager): for future in done: try: future.result() - except Exception as e: + except (Exception, GeneratorExit) as e: log.error("Could not stop device hypervisor {}".format(e), exc_info=1) continue @@ -154,7 +154,7 @@ class Dynamips(BaseManager): for future in done: try: future.result() - except Exception as e: + except (Exception, GeneratorExit) as e: log.error("Could not delete device {}".format(e), exc_info=1) @asyncio.coroutine diff --git a/gns3server/modules/project.py b/gns3server/modules/project.py index 0c87cc37..2504656e 100644 --- a/gns3server/modules/project.py +++ b/gns3server/modules/project.py @@ -363,7 +363,7 @@ class Project: for future in done: try: future.result() - except Exception as e: + except (Exception, GeneratorExit) as e: log.error("Could not close VM or device {}".format(e), exc_info=1) if cleanup and os.path.exists(self.path): From 4aeb451ffdb858e8007892d65ef89a28451cddfc Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 26 Jul 2015 15:28:14 -0600 Subject: [PATCH 3/8] Makes sure the loop is running when closing the app. --- gns3server/server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gns3server/server.py b/gns3server/server.py index 8fed024c..8ceb006c 100644 --- a/gns3server/server.py +++ b/gns3server/server.py @@ -252,7 +252,8 @@ class Server: # TypeError: async() takes 1 positional argument but 3 were given log.warning("TypeError exception in the loop {}".format(e)) finally: - if self._handler: + if self._handler and self._loop.is_running(): self._loop.run_until_complete(self._handler.finish_connections()) server.close() - self._loop.run_until_complete(app.finish()) + if self._loop.is_running(): + self._loop.run_until_complete(app.finish()) From 76fe0cb316efde67743fd3cebad750f8e5201fa5 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 26 Jul 2015 15:51:55 -0600 Subject: [PATCH 4/8] Fixes IOS adapters and WICS cannot be removed. Fixes #282. --- gns3server/modules/dynamips/nodes/router.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gns3server/modules/dynamips/nodes/router.py b/gns3server/modules/dynamips/nodes/router.py index 4954d698..edc6a55b 100644 --- a/gns3server/modules/dynamips/nodes/router.py +++ b/gns3server/modules/dynamips/nodes/router.py @@ -160,7 +160,7 @@ class Router(BaseVM): for slot in self._slots: if slot: slot = str(slot) - router_info["slot" + str(slot_number)] = slot + router_info["slot" + str(slot_number)] = slot slot_number += 1 # add the wics @@ -168,6 +168,8 @@ class Router(BaseVM): for wic_slot_number in range(0, len(self._slots[0].wics)): if self._slots[0].wics[wic_slot_number]: router_info["wic" + str(wic_slot_number)] = str(self._slots[0].wics[wic_slot_number]) + else: + router_info["wic" + str(wic_slot_number)] = None return router_info From 5986849b6768e2c465a0db346cd8f84b9270c6ac Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 27 Jul 2015 11:40:01 -0600 Subject: [PATCH 5/8] Catch ProcessLookupError when updating iouyap config. Fixes #255. --- gns3server/modules/iou/iou_vm.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/gns3server/modules/iou/iou_vm.py b/gns3server/modules/iou/iou_vm.py index d826a2ab..8a3d55d8 100644 --- a/gns3server/modules/iou/iou_vm.py +++ b/gns3server/modules/iou/iou_vm.py @@ -862,7 +862,10 @@ class IOUVM(BaseVM): port_number=port_number)) if self.is_iouyap_running(): self._update_iouyap_config() - os.kill(self._iouyap_process.pid, signal.SIGHUP) + try: + os.kill(self._iouyap_process.pid, signal.SIGHUP) + except ProcessLookupError: + log.error("Could not update iouyap configuration: process (PID={}) not found".format(self._iouyap_process.pid)) def adapter_remove_nio_binding(self, adapter_number, port_number): """ @@ -894,8 +897,10 @@ class IOUVM(BaseVM): port_number=port_number)) if self.is_iouyap_running(): self._update_iouyap_config() - os.kill(self._iouyap_process.pid, signal.SIGHUP) - + try: + os.kill(self._iouyap_process.pid, signal.SIGHUP) + except ProcessLookupError: + log.error("Could not update iouyap configuration: process (PID={}) not found".format(self._iouyap_process.pid)) return nio @property @@ -1052,7 +1057,10 @@ class IOUVM(BaseVM): if self.is_iouyap_running(): self._update_iouyap_config() - os.kill(self._iouyap_process.pid, signal.SIGHUP) + try: + os.kill(self._iouyap_process.pid, signal.SIGHUP) + except ProcessLookupError: + log.error("Could not update iouyap configuration: process (PID={}) not found".format(self._iouyap_process.pid)) @asyncio.coroutine def stop_capture(self, adapter_number, port_number): @@ -1085,4 +1093,7 @@ class IOUVM(BaseVM): port_number=port_number)) if self.is_iouyap_running(): self._update_iouyap_config() - os.kill(self._iouyap_process.pid, signal.SIGHUP) + try: + os.kill(self._iouyap_process.pid, signal.SIGHUP) + except ProcessLookupError: + log.error("Could not update iouyap configuration: process (PID={}) not found".format(self._iouyap_process.pid)) From bdb23d6d3bf57fe91095ae27561aba2182e61d82 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 27 Jul 2015 12:10:01 -0600 Subject: [PATCH 6/8] 1.3.8 --- CHANGELOG | 17 +++++++++++++++++ gns3server/version.py | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 278f66b7..5382d670 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,22 @@ # Change Log +## 1.3.8 27/07/2015 + +* Catch ProcessLookupError when updating iouyap config. Fixes #255. +* Fixes IOS adapters and WICS cannot be removed. Fixes #282. +* Makes sure the loop is running when closing the app. +* Catch GeneratorExit exception. Fixes #231. +* Fixes missing chipset info for VirtualBox VM. Fixes #254. +* Fixes IOURC upload. +* Restore images & projects tarballs +* Allow users to backup projects and images. +* Update gns3.conf.upstart. +* Fix incorrect vboxmanage sudo command. +* Backport from 1.4: option to drop nvram & disk files for IOS routers in order to save disk space. +* Backport from 1.4: Remove timeout to wait for connections to finish. +* Backport from 1.4: Fixes RuntimeError: Event loop is closed. +* Backport from 1.4: Bind host on 0.0.0.0 when checking for a free UDP port. + ## 1.3.7 22/06/2015 * Prevent install on Python 2 diff --git a/gns3server/version.py b/gns3server/version.py index 4a3ea166..3ac141a8 100644 --- a/gns3server/version.py +++ b/gns3server/version.py @@ -23,5 +23,5 @@ # or negative for a release candidate or beta (after the base version # number has been incremented) -__version__ = "1.3.8dev1" -__version_info__ = (1, 3, 8, -99) +__version__ = "1.3.8" +__version_info__ = (1, 3, 8, 0) From c2ba3f923ebb40b43eac09a4661161370810de0b Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Mon, 27 Jul 2015 20:11:49 +0200 Subject: [PATCH 7/8] 1.3.9dev1 --- gns3server/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/version.py b/gns3server/version.py index 3ac141a8..07340beb 100644 --- a/gns3server/version.py +++ b/gns3server/version.py @@ -23,5 +23,5 @@ # or negative for a release candidate or beta (after the base version # number has been incremented) -__version__ = "1.3.8" -__version_info__ = (1, 3, 8, 0) +__version__ = "1.3.9dev1" +__version_info__ = (1, 3, 9, -99) From 003c2f5f0b2037691ea7aa631be950047e95feef Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Tue, 28 Jul 2015 16:48:22 +0200 Subject: [PATCH 8/8] New crash report key --- gns3server/crash_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/crash_report.py b/gns3server/crash_report.py index 660ddb64..41a66292 100644 --- a/gns3server/crash_report.py +++ b/gns3server/crash_report.py @@ -51,7 +51,7 @@ class CrashReport: Report crash to a third party service """ - DSN = "sync+https://c06a407cbe0d4036be7873b54ebfa0ef:d6129d3fe91a4ea0b96ecbcf99678b1b@app.getsentry.com/38482" + DSN = "sync+https://9f469ce68db74d6198ab0f1c2692927d:f9121d079e98421191c88af6d7c14b5e@app.getsentry.com/38482" if hasattr(sys, "frozen"): cacert = os.path.join(os.getcwd(), "cacert.pem") if os.path.isfile(cacert):