Module: check_mk
Branch: master
Commit: 7abb0a34dc3dadaf7632000beb3ba40ab699ead1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7abb0a34dc3dad…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jan 30 11:52:58 2015 +0100
#1925 FIX Fix missing auxilliary tags that have their own topic
If you have created an auxiliary host tag with a topic this
is not also used in any of the normal host tags then that tag
would not be displayed in the rule editor. This has been fixed.
---
.werks/1925 | 12 ++++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 55 ++++++++++++++++++++++++++++++----------------------
3 files changed, 45 insertions(+), 23 deletions(-)
diff --git a/.werks/1925 b/.werks/1925
new file mode 100644
index 0000000..662139d
--- /dev/null
+++ b/.werks/1925
@@ -0,0 +1,12 @@
+Title: Fix missing auxilliary tags that have their own topic
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1422615110
+
+If you have created an auxiliary host tag with a topic this
+is not also used in any of the normal host tags then that tag
+would not be displayed in the rule editor. This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index dc86636..b9efbf5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -174,6 +174,7 @@
* 1879 FIX: Not showing "only show permitted hosts/services" option for
users not having "see all" permissions...
* 1922 FIX: Fix exception in saving of hosttags if hosttag has at least one auxiliary
tag
* 1883 FIX: Fixed lossing service context when cloning a rule
+ * 1925 FIX: Fix missing auxilliary tags that have their own topic...
Notifications:
* 1662 notification plugin spectrum: finalized script. now able to handle host
notications
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index ad8d710..ab78876 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -14993,7 +14993,7 @@ def mode_edit_rule(phase, new = False):
html.write('<img class=ruleyesno align=top
src="images/rule_%s.png"> ' % img)
html.radiobutton("value", img, value == val, _("Make the
outcome of the ruleset <b>%s</b><br>") % posneg)
- # Addiitonal rule options
+ # Additonal rule options
vs_rule_options.render_input("options", rule_options)
forms.end()
@@ -15054,36 +15054,45 @@ def render_condition_editor(tag_specs, varprefix=""):
varprefix, id, not div_is_open and "display: none;" or
""))
- auxtags = dict(group_hosttags_by_topic(config.wato_aux_tags))
+ auxtags = group_hosttags_by_topic(config.wato_aux_tags)
hosttags = group_hosttags_by_topic(config.wato_host_tags)
- make_foldable = len(hosttags) > 1
- for topic, grouped_tags in hosttags:
+ all_topics = set([])
+ for topic, taggroups in auxtags + hosttags:
+ all_topics.add(topic)
+ all_topics = list(all_topics)
+ all_topics.sort()
+ make_foldable = len(all_topics) > 1
+ for topic in all_topics:
if make_foldable:
html.begin_foldable_container("topic", topic, True,
"<b>%s</b>" % (_u(topic)))
html.write("<table class=\"hosttags\">")
# Show main tags
- for entry in grouped_tags:
- id, title, choices = entry[:3]
- html.write("<tr><td class=title>%s:
</td>" % _u(title))
- default_tag, deflt = current_tag_setting(choices)
- tag_condition_dropdown("tag", deflt, id)
- if len(choices) == 1:
- html.write(" " + _("set"))
- else:
- html.select(varprefix + "tagvalue_" + id,
- [(t[0], _u(t[1])) for t in choices if t[0] != None],
deflt=default_tag)
- html.write("</div>")
- html.write("</td></tr>")
+ for t, grouped_tags in hosttags:
+ if t == topic:
+ for entry in grouped_tags:
+ id, title, choices = entry[:3]
+ html.write("<tr><td class=title>%s:
</td>" % _u(title))
+ default_tag, deflt = current_tag_setting(choices)
+ tag_condition_dropdown("tag", deflt, id)
+ if len(choices) == 1:
+ html.write(" " + _("set"))
+ else:
+ html.select(varprefix + "tagvalue_" + id,
+ [(t[0], _u(t[1])) for t in choices if t[0] != None],
deflt=default_tag)
+ html.write("</div>")
+ html.write("</td></tr>")
# And auxiliary tags
- for id, title in sorted(auxtags.get(topic, []), key = lambda x: x[0]):
- html.write("<tr><td class=title>%s:
</td>" % _u(title))
- default_tag, deflt = current_tag_setting([(id, _u(title))])
- tag_condition_dropdown("auxtag", deflt, id)
- html.write(" " + _("set"))
- html.write("</div>")
- html.write("</td></tr>")
+ for t, grouped_tags in auxtags:
+ if t == topic:
+ for id, title in grouped_tags:
+ html.write("<tr><td class=title>%s:
</td>" % _u(title))
+ default_tag, deflt = current_tag_setting([(id, _u(title))])
+ tag_condition_dropdown("auxtag", deflt, id)
+ html.write(" " + _("set"))
+ html.write("</div>")
+ html.write("</td></tr>")
html.write("</table>")
if make_foldable: