Disabled services" for remote sites
Message-ID: <59ba352a.ymqR9zpb1ApqwpkL%si(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 243cebeeda8cc99bed0c9451c48a5f4efd0f79a8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=243cebeeda8cc9…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Sep 13 14:50:31 2017 +0200
5126 FIX Service discovery dialog: Fixed moving services to "Disabled services"
for remote sites
Change-Id: Idce604462a3f0a81834d26bf8d371b3745763bdc
---
.werks/5126 | 12 ++++++++++++
web/htdocs/wato.py | 10 ++++++----
web/htdocs/watolib.py | 4 ++--
3 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/.werks/5126 b/.werks/5126
new file mode 100644
index 0000000..f68c7e3
--- /dev/null
+++ b/.werks/5126
@@ -0,0 +1,12 @@
+Title: Service discovery dialog: Fixed moving services to "Disabled services"
for remote sites
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1505306976
+
+Previously moving services to table "Disabled services" was broken.
+This concerned only hosts belonging to remote sites and has been fixed.
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index ce93230..243c617 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2870,9 +2870,11 @@ class ModeDiscovery(WatoMode):
services_to_save[(check_type, item)] = paramstring
if apply_changes:
- self._save_services(services_to_save)
+ need_sync = False
if remove_disabled_rule or add_disabled_rule:
self._save_host_service_enable_disable_rules(remove_disabled_rule,
add_disabled_rule)
+ need_sync = True
+ self._save_services(services_to_save, need_sync)
def page(self):
@@ -2932,13 +2934,13 @@ class ModeDiscovery(WatoMode):
# .--action helper-------------------------------------------------------.
- def _save_services(self, checks):
+ def _save_services(self, checks, need_sync):
host = self._host
hostname = host.name()
- check_mk_automation(host.site_id(), "set-autochecks", [hostname],
checks)
message = _("Saved check configuration of host '%s' with %d
services") % \
(hostname, len(checks))
- add_service_change(host, "set-autochecks", message)
+ add_service_change(host, "set-autochecks", message,
need_sync=need_sync)
+ check_mk_automation(host.site_id(), "set-autochecks", [hostname],
checks)
def _save_host_service_enable_disable_rules(self, to_enable, to_disable):
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index edc933c..c498b0f 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -245,8 +245,8 @@ def add_change(action_name, text, obj=None, add_user=True,
need_sync=None,
need_sync, need_restart, domains, sites)
-def add_service_change(host, action_name, text):
- add_change(action_name, text, obj=host, sites=[host.site_id()], need_sync=False)
+def add_service_change(host, action_name, text, need_sync=False):
+ add_change(action_name, text, obj=host, sites=[host.site_id()], need_sync=need_sync)
def get_number_of_pending_changes():