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:
Module: check_mk
Branch: master
Commit: e5946d15e3c21022c0499c83938fc92fd5ebb2c9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e5946d15e3c210…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 10 15:37:49 2015 +0100
Made perfdata split work with python<2.5
---
web/htdocs/metrics.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index 3bca3e0..98b2a84 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -275,6 +275,13 @@ def mix_colors(a, b):
# | Parsing of performance data into metrics, evaluation of expressions |
# '----------------------------------------------------------------------'
+
+def split_perf_data(perf_data_string):
+ # In python < 2.5 shlex.split can not deal with unicode strings. But we always
+ # have unicode strings. So encode and decode again.
+ return map(lambda s: s.decode('utf-8'), shlex.split(perf_data_string.encode('utf-8')))
+
+
# Convert perf_data_string into perf_data, extract check_command
def parse_perf_data(perf_data_string, check_command=None):
# Strip away arguments like in "check_http!-H mathias-kettner.de"
@@ -285,7 +292,7 @@ def parse_perf_data(perf_data_string, check_command=None):
return None, check_command
# Split the perf data string into parts. Preserve quoted strings!
- parts = shlex.split(perf_data_string)
+ parts = split_perf_data(perf_data_string)
# Try if check command is appended to performance data
# in a PNP like style