mirror of
https://github.com/GNS3/gns3-server
synced 2024-11-13 20:08:55 +00:00
Fix error when the startup config file is missing
Fix https://github.com/GNS3/gns3-gui/issues/1877
This commit is contained in:
parent
b132d95a04
commit
2884a40769
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user