[omd-commits] OMD Git: omd: omd: update: Ensure execution of the target versions hooks

git version control git at mathias-kettner.de
Mon Apr 15 14:59:51 CEST 2013


Module:   omd
Branch:   master
Commit:   c249412699a209e89a686dc78d5129727c51d92c
URL:      http://omdistro.org/projects/omd/repository/revisions/c249412699a209e89a686dc78d5129727c51d92c

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Mon Apr 15 14:59:49 2013 +0200
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Mon Apr 15 14:59:49 2013 +0200

omd: update: Ensure execution of the target versions hooks

---

 Changelog        |    6 ++++--
 packages/omd/omd |    9 +++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/Changelog b/Changelog
index 805e58b..c8f7743 100644
--- a/Changelog
+++ b/Changelog
@@ -11,8 +11,10 @@ This file documents the revision history for the Open Monitoring Distribution
             - Changed path for check manpages from share/doc/check_mk/checks
               to share/check_mk/checkman to match the local/ path
           - NagVis: Update to 1.7.7
-          - omd: new option --no-autostart, -A for omd create (set AUTOSTART
-                 to off right at creation, useful for test sites!)
+          - omd:
+            - new option --no-autostart, -A for omd create (set AUTOSTART
+              to off right at creation, useful for test sites!)
+            - update: Ensure execution of the target versions hooks
           - PNP4Nagios: Updated to version 0.6.21
              - Added INIT hooks to npcd and pnp_gearman_worker scripts
           - Support Ubuntu 12.10 (Quantal)
diff --git a/packages/omd/omd b/packages/omd/omd
index 34e8ada..1b54ca2 100644
--- a/packages/omd/omd
+++ b/packages/omd/omd
@@ -1689,10 +1689,9 @@ def load_hook_dependencies():
             hook["active"] = False
         else:
             hook["active"] = True
-        
 
-def refresh_hooks():
-    config_load_hooks()
+def refresh_hooks(force_reload = False):
+    config_load_hooks(force_reload)
     config_set_all() # execute 'set' functions with current values
     call_all_hooks("refresh")
     config_save()
@@ -2696,7 +2695,9 @@ def main_update(args, options={}):
     create_version_symlink(g_sitename, to_version)
 
     # Let hooks do their work and update configuration
-    refresh_hooks()
+    # Ensure the hooks are reloaded prior to execution to be sure
+    # the hooks of the target version are executed
+    refresh_hooks(True)
 
 def main_umount(args, options = {}):
     global g_sitename



More information about the omd-commits mailing list