mirror of
https://github.com/GNS3/gns3-server
synced 2024-12-26 00:38:10 +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:
|
try:
|
||||||
startup_config_path = os.path.join(self._working_directory, startup_config)
|
startup_config_path = os.path.join(self._working_directory, startup_config)
|
||||||
with open(startup_config_path) as f:
|
if os.path.exists(startup_config_path):
|
||||||
self._startup_config_content = f.read()
|
with open(startup_config_path) as f:
|
||||||
|
self._startup_config_content = f.read()
|
||||||
|
else:
|
||||||
|
self._startup_config_content = ''
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
raise DynamipsError("Cannot access the startup-config {}: {}".format(startup_config_path, e))
|
raise DynamipsError("Cannot access the startup-config {}: {}".format(startup_config_path, e))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user