Module: check_mk
Branch: master
Commit: 6d388ccd9bbeb27c9c18ecdec4244f7e27ecb7af
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d388ccd9bbeb2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 12 18:07:22 2019 +0100
Fixed applying custom host attribute changes to folder hierarchy
When a custom host attribute is changed this may directly apply the
hosts.mk files, for example when toggling the option "Add as custom
macro". In previous 1.6 code this change was only applied after
rewriting the hosts.mk files (by editing hosts or folders or some
other action).
Change-Id: I2602223cddcb88d6cefbe5c37d64e119942ce5bc
---
cmk/gui/wato/pages/custom_attributes.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/cmk/gui/wato/pages/custom_attributes.py
b/cmk/gui/wato/pages/custom_attributes.py
index 0a01d92..dbe0598 100644
--- a/cmk/gui/wato/pages/custom_attributes.py
+++ b/cmk/gui/wato/pages/custom_attributes.py
@@ -30,6 +30,7 @@ import os
import pprint
import re
+import cmk.gui.config as config
import cmk.gui.forms as forms
from cmk.gui.table import table_element
import cmk.gui.userdb as userdb
@@ -39,7 +40,6 @@ from cmk.gui.exceptions import MKUserError
from cmk.gui.globals import html
from cmk.gui.i18n import _
from cmk.gui.watolib.host_attributes import (
- declare_custom_host_attrs,
host_attribute_topic_registry,
transform_pre_16_host_topics,
)
@@ -52,8 +52,8 @@ def update_user_custom_attrs():
userdb.rewrite_users()
-def update_host_custom_attrs():
- declare_custom_host_attrs()
+def _update_host_custom_attrs():
+ config.load_config()
Folder.invalidate_caches()
Folder.root_folder().rewrite_hosts_files()
@@ -367,7 +367,7 @@ class ModeEditCustomHostAttr(ModeEditCustomAttr):
"e.g. in check commands or in notifications.")
def _update_config(self):
- update_host_custom_attrs()
+ _update_host_custom_attrs()
def title(self):
if self._new:
@@ -486,7 +486,7 @@ class ModeCustomHostAttrs(ModeCustomAttrs):
return 'host'
def _update_config(self):
- update_host_custom_attrs()
+ _update_host_custom_attrs()
def title(self):
return _("Custom Host Attributes")