Module: check_mk
Branch: master
Commit: 7da5c18a660dd706d36673dd7a386d0f4c866eaf
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7da5c18a660dd7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Oct 18 08:21:09 2017 +0200
Cleaned up some debug output; execute "omd config set" + restart only when
needed
Change-Id: I897c65b4b0745b4483b86011a0c6dd78983c6da0
---
tests/testlib/__init__.py | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/tests/testlib/__init__.py b/tests/testlib/__init__.py
index f5228fd..d0b1b52 100644
--- a/tests/testlib/__init__.py
+++ b/tests/testlib/__init__.py
@@ -611,10 +611,15 @@ class Site(object):
def set_config(self, key, val, with_restart=False):
+ if self.get_config(key) == val:
+ print "omd config: %s is already at %r" % (key, val)
+ return
+
if with_restart:
print "Stopping site"
self.stop()
+ print "omd config: Set %s to %r" % (key, val)
assert self.omd("config", "set", key, val) == 0
if with_restart:
@@ -1080,7 +1085,6 @@ class CMKWebSession(WebSession):
host = self.get_host(hostname)
- print host
assert host["hostname"] == hostname
assert host["path"] == folder
assert host["attributes"] == attributes
@@ -1109,7 +1113,6 @@ class CMKWebSession(WebSession):
}),
}, output_format="python")
- print result
assert type(result) == dict
assert "ruleset" in result
assert "configuration_hash" in result
@@ -1268,7 +1271,6 @@ class CMKWebSession(WebSession):
# might not reflect the changes yet. Ask the core for a successful reload.
def config_reloaded():
new_t = self.site.live.query_value("GET status\nColumns:
program_start\n")
- print "New config load time: %s" % new_t
return new_t > old_t
reload_time, timeout = time.time(), 10
@@ -1362,14 +1364,14 @@ class CMKEventConsole(CMKWebSession):
def activate_changes(self, web):
old_t = web.site.live.query_value("GET eventconsolestatus\nColumns:
status_config_load_time\n")
- print "Old config load time: %s" % old_t
+ #print "Old config load time: %s" % old_t
assert old_t > time.time() - 86400
super(CMKEventConsole, self).activate_changes(allow_foreign_changes=True)
def config_reloaded():
new_t = web.site.live.query_value("GET eventconsolestatus\nColumns:
status_config_load_time\n")
- print "New config load time: %s" % new_t
+ #print "New config load time: %s" % new_t
return new_t > old_t
reload_time, timeout = time.time(), 10