Module: check_mk
Branch: master
Commit: 56293e2e5489978d616be73a4570270f70e55fb5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=56293e2e548997…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 11 10:29:09 2015 +0100
#2760 FIX Fixed case where "activate changes" was not commiting the pending
changes entries correctly
It could happen that activate changes was not commiting the pending changes entries
correctly
after applying the changes. Right after activation the changes look ok, but when coming
back to
another WATO page, the changes are visible as pending again.
---
.werks/2760 | 12 ++++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 12 +++++++++++-
3 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/.werks/2760 b/.werks/2760
new file mode 100644
index 0000000..d6cf35f
--- /dev/null
+++ b/.werks/2760
@@ -0,0 +1,12 @@
+Title: Fixed case where "activate changes" was not commiting the pending
changes entries correctly
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1447234005
+
+It could happen that activate changes was not commiting the pending changes entries
correctly
+after applying the changes. Right after activation the changes look ok, but when coming
back to
+another WATO page, the changes are visible as pending again.
diff --git a/ChangeLog b/ChangeLog
index f611d18..ed68509 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -99,6 +99,7 @@
* 2723 FIX: Hiding "discard changes button" after successful activation of
changes
* 2742 FIX: Make selection of folders and host group tag filter use nicer drawing
characters
* 2774 FIX: Fix exception when deleting certain types of MIBs
+ * 2760 FIX: Fixed case where "activate changes" was not commiting the
pending changes entries correctly...
Notifications:
* 2728 FIX: Removed debug notification script (was not executable)...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 7d6f3d1..1742ca6 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -11820,7 +11820,13 @@ class SiteAttribute(Attribute):
# "need_restart" : True, # True, if remote site needs a restart (cmk -R)
def load_replication_status():
try:
- return eval(file(repstatus_file).read())
+ repstatus = eval(file(repstatus_file).read())
+
+ for site_id, status in repstatus.items():
+ if site_is_local(site_id): # nevery sync to local site
+ status["need_sync"] = False
+
+ return repstatus
except:
return {}
@@ -11841,6 +11847,10 @@ def update_replication_status(site_id, vars, times = {}):
else:
repstatus.setdefault(site_id, {})
repstatus[site_id].update(vars)
+
+ if site_is_local(site_id): # nevery sync to local site
+ repstatus[site_id]["need_sync"] = False
+
old_times = repstatus[site_id].setdefault("times", {})
for what, duration in times.items():
if what not in old_times: