Module: check_mk
Branch: master
Commit: 2c42c45f9de37988a5cf92a530006eae4f606809
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2c42c45f9de379…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Mar 6 07:58:12 2019 +0100
7229 FIX Fixed missing builtin topics in topic dropdown on host tag edit page
Change-Id: Id6fc36927f3a787fdee1b2e6db7a125533264edf
---
.werks/7229 | 10 ++++++++++
cmk/gui/wato/pages/host_tags.py | 10 +++++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/7229 b/.werks/7229
new file mode 100644
index 0000000..d5ed503
--- /dev/null
+++ b/.werks/7229
@@ -0,0 +1,10 @@
+Title: Fixed missing builtin topics in topic dropdown on host tag edit page
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1551855478
+Class: fix
+
+
diff --git a/cmk/gui/wato/pages/host_tags.py b/cmk/gui/wato/pages/host_tags.py
index 2a7c995..507b326 100644
--- a/cmk/gui/wato/pages/host_tags.py
+++ b/cmk/gui/wato/pages/host_tags.py
@@ -311,9 +311,16 @@ class ModeEditHosttagConfiguration(WatoMode):
self._untainted_hosttags_config.load()
def _get_topic_valuespec(self):
+ # Merging of both objects would ne neat here
+ builtin_tags_config = watolib.BuiltinHosttagsConfiguration()
+ builtin_tags_config.load()
+
+ topics = set(builtin_tags_config.get_hosttag_topics())
+ topics.update(self._untainted_hosttags_config.get_hosttag_topics())
+
return OptionalDropdownChoice(
title=_("Topic"),
- choices=self._untainted_hosttags_config.get_hosttag_topics(),
+ choices=list(topics),
explicit=TextUnicode(),
otherlabel=_("Create New Topic"),
default_value=None,
@@ -373,6 +380,7 @@ class ModeEditAuxtag(ModeEditHosttagConfiguration):
changed_hosttags_config = watolib.HosttagsConfiguration()
changed_hosttags_config.load()
+
if self._is_new_aux_tag():
changed_hosttags_config.aux_tag_list.append(changed_aux_tag)
else: