Module: check_mk
Branch: master
Commit: fb2c159dbd85e098b1263c80ea138b73b3114644
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fb2c159dbd85e0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 22 18:24:11 2016 +0200
3718 FIX Changes not needing a core restart are not showing up pending changes anymore
Those changes where shown by the pending changes log but automatically commited
when opening the activate changes page.
---
.werks/3718 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/watolib.py | 43 +++++++++++++++++++------------------------
3 files changed, 31 insertions(+), 24 deletions(-)
diff --git a/.werks/3718 b/.werks/3718
new file mode 100644
index 0000000..23b799d
--- /dev/null
+++ b/.werks/3718
@@ -0,0 +1,11 @@
+Title: Changes not needing a core restart are not showing up pending changes anymore
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1469204588
+
+Those changes where shown by the pending changes log but automatically commited
+when opening the activate changes page.
diff --git a/ChangeLog b/ChangeLog
index dd164bf..e27eb62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -498,6 +498,7 @@
* 3661 FIX: Service discovery is now possible with only "modify services"
permission...
* 3152 FIX: lvm_vgs: fixed exception in host-specific settings if rule for LVM groups
is set
* 3557 FIX: Web API: get_host/get_all_hosts action now also returns the nodes of
cluster host
+ * 3718 FIX: Changes not needing a core restart are not showing up pending changes
anymore...
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 861383c..d01c1b9 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -214,7 +214,6 @@ def log_audit(linkinfo, what, message, user_id = None):
# sites have already been marked for restart. Do nothing here.
# In non-distributed mode mark for restart
def log_pending(status, linkinfo, what, message, user_id = None):
-
log_audit(linkinfo, what, message, user_id)
need_sidebar_reload()
@@ -223,35 +222,31 @@ def log_pending(status, linkinfo, what, message, user_id = None):
# pylint: disable=undefined-variable
need_to_bake_agents()
- # The latter one condition applies to slave sites
- # Otherwise slave sites would trigger the cmcrushd
- if not is_distributed() and not is_wato_slave_site():
- if status != SYNC:
- log_entry(linkinfo, what, message, "pending.log", user_id)
+ # Only add pending log entries when a restart is needed
+ if has_wato_slave_sites() or status in [ RESTART, SYNCRESTART, LOCALRESTART ]:
+ log_entry(linkinfo, what, message, "pending.log", user_id)
# Currently we add the pending to each site, regardless if
# the site is really affected. This needs to be optimized
# in future.
- else:
- log_entry(linkinfo, what, message, "pending.log", user_id)
- for siteid, site in config.sites.items():
+ for siteid, site in config.sites.items():
+ changes = {}
- changes = {}
+ # Local site can never have pending changes to be synced
+ if config.site_is_local(siteid):
+ if status in [ RESTART, SYNCRESTART ]:
+ changes["need_restart"] = True
+ else:
+ if status in [ SYNC, SYNCRESTART ]:
+ changes["need_sync"] = True
- # Local site can never have pending changes to be synced
- if config.site_is_local(siteid):
- if status in [ RESTART, SYNCRESTART ]:
- changes["need_restart"] = True
- else:
- if status in [ SYNC, SYNCRESTART ]:
- changes["need_sync"] = True
- if status in [ RESTART, SYNCRESTART ]:
- changes["need_restart"] = True
- update_replication_status(siteid, changes)
-
- # Make sure that a new snapshot for syncing will be created
- # when times comes to syncing
- remove_sync_snapshot(siteid)
+ if status in [ RESTART, SYNCRESTART ]:
+ changes["need_restart"] = True
+ update_replication_status(siteid, changes)
+
+ # Make sure that a new snapshot for syncing will be created
+ # when times comes to syncing
+ remove_sync_snapshot(siteid)
def log_exists(what):