summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2018-07-02 21:28:02 +0200
committerChristian Poessinger <christian@poessinger.com>2018-07-02 21:43:45 +0200
commitbc40e74b2d567e192385925028de4629c9caf59d (patch)
tree54f8981d55b448728e456b3ba25bf02ca50a1b28 /src
parentafb6abb8e3bf06336eb7babd121e67dc3be84b36 (diff)
downloadvyos-1x-bc40e74b2d567e192385925028de4629c9caf59d.tar.gz
vyos-1x-bc40e74b2d567e192385925028de4629c9caf59d.zip
T713: bugfix incorrect parsing of seclevel
... there was a coding error in the if clause.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/snmp.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/conf_mode/snmp.py b/src/conf_mode/snmp.py
index 0ac454197..b74d0724b 100755
--- a/src/conf_mode/snmp.py
+++ b/src/conf_mode/snmp.py
@@ -651,15 +651,15 @@ def verify(snmp):
# Depending on the configured security level
# the user has to provide additional info
- if seclevel is 'auth' or seclevel is 'priv':
+ if seclevel in ('auth', 'priv'):
if user['authPassword'] and user['authMasterKey']:
raise ConfigError('Can not mix "encrypted-key" and "plaintext-key" for user auth')
- if user['authPassword'] == '' and user['authMasterKey'] == '':
+ if (not user['authPassword'] and not user['authMasterKey']):
raise ConfigError('Must specify encrypted-key or plaintext-key for user auth')
# seclevel 'priv' is more restrictive
- if seclevel is 'priv':
+ if seclevel in ('priv'):
if user['privPassword'] and user['privMasterKey']:
raise ConfigError('Can not mix "encrypted-key" and "plaintext-key" for user privacy')