Module: check_mk
Branch: master
Commit: 3bc07010e8a3fa57f6bcb4c0f6290a26915cd4e1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3bc07010e8a3fa…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 21 10:46:12 2016 +0100
4146 FIX Fixed broken "Global settings" when having the Event Console disabled
via "omd config"
Change-Id: Ie919fd37fc923cdff0b7ccda637df9fc7f4fd82e
---
.werks/4146 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 2 +-
web/htdocs/watolib.py | 20 ++++++++++++++++++--
4 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/.werks/4146 b/.werks/4146
new file mode 100644
index 0000000..c9c05fa
--- /dev/null
+++ b/.werks/4146
@@ -0,0 +1,9 @@
+Title: Fixed broken "Global settings" when having the Event Console disabled
via "omd config"
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i4
+Date: 1482313552
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 1e0e270..16a32c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@
WATO:
* 4142 New extended search dialog for rulesets and rules...
* 4003 FIX: esx_vsphere_objects: fixed check parameters display bug during WATO
service discovery
+ * 4146 FIX: Fixed broken "Global settings" when having the Event Console
disabled via "omd config"
Notifications:
* 4197 FIX: Fix sending notification to global fallback email address
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 181110e..096f9b8 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9321,7 +9321,7 @@ def mode_edit_site(phase):
# Don't know exactly what have been changed, so better issue a change
# affecting all domains
- add_change("edit-sites", msg, sites=[id],
domains=ConfigDomain.all_classes())
+ add_change("edit-sites", msg, sites=[id],
domains=ConfigDomain.enabled_domains())
if id != config.omd_site():
# On central site issue a change only for the GUI
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 205b8d5..9836090 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -286,6 +286,11 @@ class ConfigDomain(object):
@classmethod
+ def enabled_domains(cls):
+ return [ d for d in cls.all_classes() if d.enabled() ]
+
+
+ @classmethod
def get_class(cls, ident):
for domain_class in cls.__subclasses__(): # pylint: disable=no-member
if domain_class.ident == ident:
@@ -293,6 +298,11 @@ class ConfigDomain(object):
raise NotImplementedError(_("The domain \"%s\" does not
exist") % ident)
+ @classmethod
+ def enabled(self):
+ return True
+
+
def config_dir(self):
raise NotImplementedError()
@@ -367,6 +377,12 @@ class ConfigDomainEventConsole(ConfigDomain):
ident = "ec"
in_global_settings = False
+
+ @classmethod
+ def enabled(self):
+ return config.mkeventd_enabled
+
+
def config_dir(self):
return mkeventd_config_dir
@@ -3140,7 +3156,7 @@ def register_configvar_group(title, order=None):
def load_configuration_settings():
settings = {}
- for domain in ConfigDomain.all_classes():
+ for domain in ConfigDomain.enabled_domains():
settings.update(domain().load())
return settings
@@ -3159,7 +3175,7 @@ def save_configuration_settings(vars):
if "userdb_automatic_sync" in vars:
per_domain.setdefault("multisite",
{})["userdb_automatic_sync"] = vars["userdb_automatic_sync"]
- for domain in ConfigDomain.all_classes():
+ for domain in ConfigDomain.enabled_domains():
domain().save(per_domain.get(domain, {}))