Watch for dynamips rom & nvram change

This monitor for change the file from dynamips by computing a
hash of the watched file.

The way dynamips work prevent the update of the modification time.

We can improve that by using native system for watching file but:
* it's require dependencies specific for each OS
* dependencies use C extensions
* this is only a backup if your router is cleanly shutdown we export
stuff
This commit is contained in:
Julien Duponchelle committed 2016-06-13 15:57:36 +02:00
1 parent 2bde02d459
commit 67c04a7855
5 files changed
+97 -39

No files matched your search

+1 -1
View File
@@ -503,7 +503,7 @@ class IOUVM(BaseNode):
# check if there is enough RAM to run
self.check_available_ram(self.ram)
self._nvram_watcher = FileWatcher(self._nvram_file(), self._nvram_changed)
self._nvram_watcher = FileWatcher(self._nvram_file(), self._nvram_changed, delay=10)
# created a environment variable pointing to the iourc file.
env = os.environ.copy()