Module: check_mk
Branch: master
Commit: f5b3ff1abdd24be4a83068be1d25424206451a03
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f5b3ff1abdd24b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Mar 1 11:05:46 2018 +0100
Fixed issues caused by recent data sources cleanup
Change-Id: Ib3625a8f15fe65f1170f39de8e6a97b4b569ebc9
---
cmk_base/automations/check_mk.py | 2 +-
cmk_base/dump_host.py | 2 +-
cmk_base/modes/check_mk.py | 2 +-
tests/cmk_base/test_data_sources.py | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/cmk_base/automations/check_mk.py b/cmk_base/automations/check_mk.py
index 314006f..ec1ae02 100644
--- a/cmk_base/automations/check_mk.py
+++ b/cmk_base/automations/check_mk.py
@@ -1080,7 +1080,7 @@ class AutomationDiagHost(Automation):
source.set_port(agent_port)
source.set_timeout(tcp_connect_timeout)
- output += source.run_raw(hostname, ipaddress)
+ output += source.run_raw()
return 0, output
diff --git a/cmk_base/dump_host.py b/cmk_base/dump_host.py
index 3824746..0715e9e 100644
--- a/cmk_base/dump_host.py
+++ b/cmk_base/dump_host.py
@@ -83,7 +83,7 @@ def dump_host(hostname):
agenttypes = []
sources = data_sources.DataSources(hostname, ipaddress)
for source in sources.get_data_sources():
- agenttypes.append(source.describe(hostname))
+ agenttypes.append(source.describe())
if config.is_ping_host(hostname):
agenttypes.append('PING only')
diff --git a/cmk_base/modes/check_mk.py b/cmk_base/modes/check_mk.py
index 5313411..3f61657 100644
--- a/cmk_base/modes/check_mk.py
+++ b/cmk_base/modes/check_mk.py
@@ -354,7 +354,7 @@ def mode_dump_agent(hostname):
for source in sources.get_data_sources():
if isinstance(source, data_sources.abstract.CheckMKAgentDataSource):
- output += source.run_raw(hostname, ipaddress)
+ output += source.run_raw()
# Show errors of problematic data sources
for data_source, exceptions in
data_sources.get_data_source_errors_of_host(hostname, ipaddress).items():
diff --git a/tests/cmk_base/test_data_sources.py b/tests/cmk_base/test_data_sources.py
index ea9afb7..85c7093 100644
--- a/tests/cmk_base/test_data_sources.py
+++ b/tests/cmk_base/test_data_sources.py
@@ -110,7 +110,7 @@ def _patch_data_source_run(monkeypatch, **kwargs):
}
defaults.update(kwargs)
- def run(self, hostname, ipaddress, get_raw_data=False):
+ def run(self, hostname=None, ipaddress=None, get_raw_data=False):
assert self._may_use_cache_file == defaults["_may_use_cache_file"]
assert self._no_cache == defaults["_no_cache"]
assert self._max_cachefile_age == defaults["_max_cachefile_age"]
@@ -477,7 +477,7 @@ def test_data_sources_of_hosts(clear_config_caches, monkeypatch):
config.collect_hosttags()
for hostname, host_attrs in hosts:
- sources = cmk_base.data_sources.DataSources(hostname)
+ sources = cmk_base.data_sources.DataSources(hostname, "127.0.0.1")
source_names = [ s.__class__.__name__ for s in sources.get_data_sources() ]
assert host_attrs["sources"] == source_names, \
"Wrong sources for %s" % hostname