diff --git a/daemons/ganeti-watcher b/daemons/ganeti-watcher index a8ae05889fffbad376a323e3da2b3d0389ce5ecf..a6f113fa6acffa36b59dd849e786348dd6e2a865 100755 --- a/daemons/ganeti-watcher +++ b/daemons/ganeti-watcher @@ -136,12 +136,19 @@ class WatcherState(object): if "node" not in self._data: self._data["node"] = {} + self._orig_data = self._data.copy() + def Save(self): """Save state to file, then unlock and close it. """ assert self.statefile + if self._orig_data == self._data: + logging.debug("Data didn't change, just touching status file") + os.utime(constants.WATCHER_STATEFILE, None) + return + # We need to make sure the file is locked before renaming it, otherwise # starting ganeti-watcher again at the same time will create a conflict. fd = utils.WriteFile(constants.WATCHER_STATEFILE,