Module: check_mk
Branch: master
Commit: 13368cab0c663daa74c7c32244635fd21a99ddf0
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=13368cab0c663d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Nov 13 08:28:05 2017 +0100
Minor cleanup: mode_inventory() is alone responsible for determining the list of hosts
Change-Id: I1a0e9ec32dad2f160240da03289c67ee504ace07
---
cmk_base/inventory.py | 5 -----
cmk_base/modes/check_mk.py | 4 +++-
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/cmk_base/inventory.py b/cmk_base/inventory.py
index c429c78..7ecdf2b 100644
--- a/cmk_base/inventory.py
+++ b/cmk_base/inventory.py
@@ -79,11 +79,6 @@ def do_inv(hostnames):
_ensure_directory(inventory_output_dir)
_ensure_directory(inventory_archive_dir)
- # No hosts specified: do all hosts and force caching
- if hostnames == None:
- hostnames = config.all_active_hosts()
- data_sources.abstract.DataSource.set_use_cachefile()
-
errors = []
for hostname in hostnames:
try:
diff --git a/cmk_base/modes/check_mk.py b/cmk_base/modes/check_mk.py
index d347a45..cff36c2 100644
--- a/cmk_base/modes/check_mk.py
+++ b/cmk_base/modes/check_mk.py
@@ -1163,7 +1163,9 @@ def mode_inventory(options, args):
if args:
hostnames = modes.parse_hostname_list(args, with_clusters=True)
else:
- hostnames = None
+ # No hosts specified: do all hosts and force caching
+ hostnames = config.all_active_hosts()
+ data_sources.abstract.DataSource.set_use_cachefile()
if "force" in options:
data_sources.abstract.CheckMKAgentDataSource.use_outdated_persisted_sections()