Skip to content

Commit

Permalink
Fix error when the startup config file is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-duponchelle committed Feb 22, 2017
1 parent b132d95 commit 2884a40
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gns3server/compute/dynamips/nodes/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -1551,8 +1551,11 @@ def set_configs(self, startup_config, private_config=''):

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))

Expand Down

0 comments on commit 2884a40

Please sign in to comment.