diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-10-27 23:12:10 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-10-28 00:00:38 +0100 |
commit | d6baf248fea9256a8142fb66e2bf9b19e1831cea (patch) | |
tree | 836c5c1097884bd7d627377a265fc4a6ae4ab7cf /src/conf_mode | |
parent | b666ec971486810e0f0a19a9cc411642c79e28fc (diff) | |
download | vyos-1x-d6baf248fea9256a8142fb66e2bf9b19e1831cea.tar.gz vyos-1x-d6baf248fea9256a8142fb66e2bf9b19e1831cea.zip |
snmp: fix verify() bail out early order
(cherry picked from commit ed642ff5e958c6ef43dee5ef684fb5ccf85ad8cf)
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-x | src/conf_mode/snmp.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py index fbffce751..edacc17ea 100755 --- a/src/conf_mode/snmp.py +++ b/src/conf_mode/snmp.py @@ -525,10 +525,6 @@ def verify(snmp): if snmp is None: return None - # 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] @@ -547,6 +543,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']: # |