Module: check_mk
Branch: master
Commit: c14062b3d1e59c914035c340429f50edde0f4ac6
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c14062b3d1e59c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 22 15:11:25 2019 +0100
Ensure that no user configures a tag group named "site"
This tag group is set automatically by the builtin host
attribute "site" which is implemented using the class
HostAttributeSite.
Change-Id: I1fc0b3dfd7322408aa02db487cc7e6cc2051add1
---
cmk/gui/tags.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/cmk/gui/tags.py b/cmk/gui/tags.py
index 43f9c4f..4ef3819 100644
--- a/cmk/gui/tags.py
+++ b/cmk/gui/tags.py
@@ -427,10 +427,14 @@ class TagConfig(object):
# TODO: cleanup this mess
# This validation is quite gui specific, I do not want to introduce this into the
base classes
def _validate_group(self, tag_group):
- if len(tag_group.id) == 0:
+ if not tag_group.id:
raise MKUserError("tag_id", _("Please specify an ID for your
tag group."))
_validate_tag_id(tag_group.id, "tag_id")
+ if tag_group.id == "site":
+ raise MKUserError("tag_id",
+ _("The tag group %s is reserved for internal
use.") % tag_group.id)
+
for tmp_group in self.tag_groups:
if tmp_group == tag_group:
continue