From bc40e74b2d567e192385925028de4629c9caf59d Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 2 Jul 2018 21:28:02 +0200 Subject: T713: bugfix incorrect parsing of seclevel ... there was a coding error in the if clause. --- src/conf_mode/snmp.py | 6 +++--- 1 file 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') -- cgit v1.2.3