From ed642ff5e958c6ef43dee5ef684fb5ccf85ad8cf Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 27 Oct 2019 23:12:10 +0100 Subject: snmp: fix verify() bail out early order --- src/conf_mode/snmp.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/conf_mode/snmp.py') 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']: # -- cgit v1.2.3