Module: check_mk
Branch: master
Commit: c2c3a718c16108ebdd299109a11369f320f877e7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c2c3a718c16108…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Feb 28 09:33:18 2019 +0100
Moved walk backend conditions to single place
CMK-1736
Change-Id: Ia111c4a0da64093f1fc8d65c58beddecd8d8643f
---
cmk_base/snmp.py | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/cmk_base/snmp.py b/cmk_base/snmp.py
index 50e3e48..9a69677 100644
--- a/cmk_base/snmp.py
+++ b/cmk_base/snmp.py
@@ -502,10 +502,7 @@ def _get_snmpwalk(host_config, check_plugin_name, oid, fetchoid,
column, use_snm
rowinfo = _get_cached_snmpwalk(host_config.hostname, fetchoid)
if rowinfo is None:
- if _enforce_stored_walks or config.is_usewalk_host(host_config.hostname):
- rowinfo = StoredWalkSNMPBackend().walk(host_config, fetchoid)
- else:
- rowinfo = _perform_snmpwalk(host_config, check_plugin_name, oid, fetchoid)
+ rowinfo = _perform_snmpwalk(host_config, check_plugin_name, oid, fetchoid)
if is_cachable:
_save_snmpwalk_cache(host_config.hostname, fetchoid, rowinfo)
@@ -522,7 +519,10 @@ def _perform_snmpwalk(host_config, check_plugin_name, base_oid,
fetchoid):
snmp_contexts = [None]
for context_name in snmp_contexts:
- if config.is_inline_snmp_host(host_config.hostname):
+ if _enforce_stored_walks or config.is_usewalk_host(host_config.hostname):
+ rows = StoredWalkSNMPBackend().walk(host_config, fetchoid)
+
+ elif config.is_inline_snmp_host(host_config.hostname):
rows = inline_snmp.walk(
host_config, check_plugin_name, fetchoid, base_oid,
context_name=context_name)
else: