Skip to content

Commit

Permalink
Fix export of IOU configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-duponchelle committed Jan 10, 2017
1 parent afd46ec commit df694ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion gns3server/compute/iou/iou_vm.py
Expand Up @@ -97,7 +97,9 @@ def _nvram_changed(self, path):
"""
Called when the NVRAM file has changed
"""
log.debug("NVRAM changed: {}".format(path))
self.save_configs()
self.updated()

@asyncio.coroutine
def close(self):
Expand Down Expand Up @@ -206,6 +208,8 @@ def __json__(self):
"nvram": self._nvram,
"l1_keepalives": self._l1_keepalives,
"startup_config": self.relative_startup_config_file,
"startup_config_content": self.startup_config_content,
"private_config_content": self.private_config_content,
"private_config": self.relative_private_config_file,
"use_default_iou_values": self._use_default_iou_values,
"command_line": self.command_line}
Expand Down Expand Up @@ -485,7 +489,7 @@ def start(self):
# check if there is enough RAM to run
self.check_available_ram(self.ram)

self._nvram_watcher = FileWatcher(self._nvram_file(), self._nvram_changed, delay=10)
self._nvram_watcher = FileWatcher(self._nvram_file(), self._nvram_changed, delay=2)

# created a environment variable pointing to the iourc file.
env = os.environ.copy()
Expand Down
2 changes: 1 addition & 1 deletion gns3server/utils/file_watcher.py
Expand Up @@ -56,7 +56,7 @@ def __init__(self, paths, callback, delay=1, strategy='mtime'):
self._hashed = {}
for path in self._paths:
try:
# Alder32 is a fast bu insecure hash algorithm
# Alder32 is a fast but insecure hash algorithm
self._hashed[path] = zlib.adler32(open(path, 'rb').read())
except OSError:
self._hashed[path] = None
Expand Down

0 comments on commit df694ca

Please sign in to comment.