Commit 14e15659 authored by Iustin Pop's avatar Iustin Pop
Browse files

Enable the ConfigWriter to keep track of updates

This allows external callers to determine if the configuration has been
changed.

Reviewed-by: imsnah
parent f5abe9bd
......@@ -48,6 +48,7 @@ class ConfigWriter:
"""
def __init__(self, cfg_file=None, offline=False):
self.write_count = 0
self._config_data = None
self._config_time = None
self._config_size = None
......@@ -546,6 +547,7 @@ class ConfigWriter:
f.close()
# we don't need to do os.close(fd) as f.close() did it
os.rename(name, destination)
self.write_count += 1
# re-set our cache as not to re-read the config file
try:
st = os.stat(destination)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment