summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-10-27 23:12:10 +0100
committerChristian Poessinger <christian@poessinger.com>2019-10-27 23:57:10 +0100
commited642ff5e958c6ef43dee5ef684fb5ccf85ad8cf (patch)
tree18e8c41bfa8e9ef2751adc7bbba73dd33ee2ee35
parentb86f1d702e3b67774d3a2eec1f9fa83108711798 (diff)
downloadvyos-1x-ed642ff5e958c6ef43dee5ef684fb5ccf85ad8cf.tar.gz
vyos-1x-ed642ff5e958c6ef43dee5ef684fb5ccf85ad8cf.zip
snmp: fix verify() bail out early order
-rwxr-xr-xsrc/conf_mode/snmp.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py
index 5a0c679c5..f2cc8bf17 100755
--- a/src/conf_mode/snmp.py
+++ b/src/conf_mode/snmp.py
@@ -549,10 +549,6 @@ def verify(snmp):
else:
os.chmod(snmp['script_ext'][ext], 0o555)
- # bail out early if SNMP v3 is not configured
- if not snmp['v3_enabled']:
- return None
-
for listen in snmp['listen_address']:
addr = listen[0]
port = listen[1]
@@ -571,6 +567,10 @@ def verify(snmp):
else:
print('WARNING: SNMP listen address {0} not configured!'.format(addr))
+ # bail out early if SNMP v3 is not configured
+ if not snmp['v3_enabled']:
+ return None
+
if 'v3_groups' in snmp.keys():
for group in snmp['v3_groups']:
#