From 67e346ba92e9206c6770b9d4a987cd02aa596859 Mon Sep 17 00:00:00 2001 From: grossmj Date: Sat, 21 May 2016 13:20:18 -0600 Subject: [PATCH] Fixed startup-config is lost if you change any IOS router settings. Fixes #1233. --- gns3server/modules/dynamips/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gns3server/modules/dynamips/__init__.py b/gns3server/modules/dynamips/__init__.py index b4b38aba..e5df157a 100644 --- a/gns3server/modules/dynamips/__init__.py +++ b/gns3server/modules/dynamips/__init__.py @@ -603,8 +603,8 @@ class Dynamips(BaseManager): elif startup_config_content: startup_config_path = self._create_config(vm, default_startup_config_path, startup_config_content) yield from vm.set_configs(startup_config_path) - # An empty startup config crash dynamips - else: + elif os.path.isfile(default_startup_config_path) and os.path.getsize(default_startup_config_path) == 0: + # An empty startup-config may crash Dynamips startup_config_path = self._create_config(vm, default_startup_config_path, "!\n") yield from vm.set_configs(startup_config_path)