From 2884a40769039c451be233d95b48c3005b9b5056 Mon Sep 17 00:00:00 2001 From: Julien Duponchelle Date: Wed, 22 Feb 2017 09:28:34 +0100 Subject: [PATCH] Fix error when the startup config file is missing Fix https://github.com/GNS3/gns3-gui/issues/1877 --- gns3server/compute/dynamips/nodes/router.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gns3server/compute/dynamips/nodes/router.py b/gns3server/compute/dynamips/nodes/router.py index e43b827f..e0f2b673 100644 --- a/gns3server/compute/dynamips/nodes/router.py +++ b/gns3server/compute/dynamips/nodes/router.py @@ -1551,8 +1551,11 @@ class Router(BaseNode): try: startup_config_path = os.path.join(self._working_directory, startup_config) - with open(startup_config_path) as f: - self._startup_config_content = f.read() + if os.path.exists(startup_config_path): + with open(startup_config_path) as f: + self._startup_config_content = f.read() + else: + self._startup_config_content = '' except OSError as e: raise DynamipsError("Cannot access the startup-config {}: {}".format(startup_config_path, e))