Module: check_mk
Branch: master
Commit: 7a19b469c225a1104ca33de2b4adc69d70a0552d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7a19b469c225a1…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 21 12:55:51 2011 +0100
Bugfix: Calling activate_changes hook also in distributed WATO setups
---
ChangeLog | 1 +
web/htdocs/wato.py | 7 +++++--
web/plugins/wato/nagvis_auth.py | 5 +++--
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index bc60218..c3a3e6f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
* Optimized wraps in host lists tag column
* Bulk inventory: Remove leading pipe signs in progress bar on main
folder inventory
+ * Bugfix: Calling activate_changes hook also in distributed WATO setups
1.1.13i1:
Multisite:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index f2c7740..ea83557 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2580,7 +2580,6 @@ def mode_changelog(phase):
else:
try:
check_mk_local_automation("restart")
- call_hook_activate_changes()
except Exception, e:
if config.debug:
raise
@@ -3141,6 +3140,11 @@ def check_mk_local_automation(command, args=[],
indata=""):
log_audit(None, "automation", "Automation command %s failed
with exit code %d: %s" % (" ".join(cmd), exitcode, outdata))
raise MKGeneralException("Error running <tt>%s</tt> (exit code
%d): <pre>%s</pre>%s" %
(" ".join(cmd), exitcode, hilite_errors(outdata), sudo_msg))
+
+ # On successful "restart" command execute the activate changes hook
+ if command == 'restart':
+ call_hook_activate_changes()
+
try:
if config.debug:
log_audit(None, "automation", "Result from automation:
%s" % outdata)
@@ -7010,7 +7014,6 @@ def automation_push_snapshot():
log_audit(None, "replication", _("Synchronized with master (my
site id is %s.)") % site_id)
if html.var("restart", "no") == "yes":
check_mk_local_automation("restart")
- call_hook_activate_changes()
return True
except Exception, e:
if config.debug:
diff --git a/web/plugins/wato/nagvis_auth.py b/web/plugins/wato/nagvis_auth.py
index aab63fb..d33fdbd 100644
--- a/web/plugins/wato/nagvis_auth.py
+++ b/web/plugins/wato/nagvis_auth.py
@@ -178,5 +178,6 @@ if config.wato_write_nagvis_auth and defaults.omd_root:
[]
)
- api.register_hook('users-saved', generate_auth_file)
- api.register_hook('roles-saved', lambda x: generate_auth_file(load_users()))
+ api.register_hook('users-saved', generate_auth_file)
+ api.register_hook('roles-saved', lambda x:
generate_auth_file(load_users()))
+ api.register_hook('activate-changes', lambda x:
generate_auth_file(load_users()))