Module: check_mk
Branch: master
Commit: 453cd7b2455b71ad7652f64fecf8ff59a2efe106
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=453cd7b2455b71…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Sun May 5 13:26:12 2019 +0200
Cleanup test config: Only append tags in case there are some set
Change-Id: Id75b97fd30ed0aece243665b926cc2988a08d478
---
tests/testlib/base.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tests/testlib/base.py b/tests/testlib/base.py
index d31bc4b..41b01c1 100644
--- a/tests/testlib/base.py
+++ b/tests/testlib/base.py
@@ -19,7 +19,8 @@ class Scenario(object):
if tags is None:
tags = []
- self.config["all_hosts"].append("%s|%s" % (hostname,
"|".join(tags)))
+ name_with_tags = hostname if not tags else "%s|%s" % (hostname,
"|".join(tags))
+ self.config["all_hosts"].append(name_with_tags)
self.config["host_paths"][hostname] = folder
#self.config["host_tags"][hostname] = tags
return self
@@ -29,7 +30,7 @@ class Scenario(object):
tags = []
if nodes is None:
nodes = []
- name_with_tags = "%s|%s" % (hostname, "|".join(tags))
+ name_with_tags = hostname if not tags else "%s|%s" % (hostname,
"|".join(tags))
self.config["clusters"][name_with_tags] = nodes
self.config["host_paths"][hostname] = folder
#self.config["host_tags"][hostname] = tags