diff --git a/gns3server/modules/attic.py b/gns3server/modules/attic.py index 9a31653e..cc1bc1a6 100644 --- a/gns3server/modules/attic.py +++ b/gns3server/modules/attic.py @@ -67,13 +67,10 @@ def find_unused_port(start_port, end_port, host='127.0.0.1', socket_type="TCP", return port except OSError as e: last_exception = e - if e.errno == errno.EADDRINUSE or e.errno == errno.EACCES: # socket already in use or permission denied - if port + 1 == end_port: - break - else: - continue + if port + 1 == end_port: + break else: - raise Exception("Could not find an unused port between {} and {} on host {}: {}".format(start_port, end_port, host, e)) + continue raise Exception("Could not find a free port between {} and {} on host {}, last exception: {}".format(start_port, end_port, host, last_exception)) diff --git a/gns3server/modules/dynamips/__init__.py b/gns3server/modules/dynamips/__init__.py index a69518d2..8041e43c 100644 --- a/gns3server/modules/dynamips/__init__.py +++ b/gns3server/modules/dynamips/__init__.py @@ -157,7 +157,10 @@ class Dynamips(IModule): # automatically save configs for all router instances for router_id in self._routers: router = self._routers[router_id] - router.save_configs() + try: + router.save_configs() + except DynamipsError: + continue # stop all Dynamips hypervisors if self._hypervisor_manager: @@ -232,7 +235,10 @@ class Dynamips(IModule): # automatically save configs for all router instances for router_id in self._routers: router = self._routers[router_id] - router.save_configs() + try: + router.save_configs() + except DynamipsError: + continue # stop all Dynamips hypervisors if self._hypervisor_manager: diff --git a/gns3server/modules/qemu/qemu_vm.py b/gns3server/modules/qemu/qemu_vm.py index 6cb2efa1..b9e8ee24 100644 --- a/gns3server/modules/qemu/qemu_vm.py +++ b/gns3server/modules/qemu/qemu_vm.py @@ -715,7 +715,7 @@ class QemuVM(object): # create a "FLASH" with 256MB if no disk image has been specified hda_disk = os.path.join(self._working_dir, "flash.qcow2") if not os.path.exists(hda_disk): - retcode = subprocess.call([qemu_img_path, "create", "-f", "qcow2", hda_disk, "256M"]) + retcode = subprocess.call([qemu_img_path, "create", "-f", "qcow2", hda_disk, "128M"]) log.info("{} returned with {}".format(qemu_img_path, retcode)) except OSError as e: