diff options
author | Leonid Korokh <lkorokh@gmail.com> | 2025-06-02 16:13:14 +0300 |
---|---|---|
committer | Leonid Korokh <lkorokh@gmail.com> | 2025-06-02 16:13:14 +0300 |
commit | 44ad57f793c838b24d31575eeb79609b227395e4 (patch) | |
tree | 7b0d4312795b6a986313e027b65d87e344ddb517 | |
parent | 7b2bf746a36bd5c34658b477986b0297f6963ceb (diff) | |
download | vyos-1x-44ad57f793c838b24d31575eeb79609b227395e4.tar.gz vyos-1x-44ad57f793c838b24d31575eeb79609b227395e4.zip |
openconnect: T7511: fix ruff warnings
-rwxr-xr-x | src/conf_mode/vpn_openconnect.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/conf_mode/vpn_openconnect.py b/src/conf_mode/vpn_openconnect.py index 38d03fd6f..391034a94 100755 --- a/src/conf_mode/vpn_openconnect.py +++ b/src/conf_mode/vpn_openconnect.py @@ -106,7 +106,7 @@ def verify(ocserv): users_wo_key = [] for user, user_config in ocserv["authentication"]["local_users"]["username"].items(): # User has no OTP key defined - if dict_search('otp.key', user_config) == None: + if dict_search('otp.key', user_config) is None: users_wo_key.append(user) if users_wo_key: raise ConfigError(f'OTP enabled, but no OTP key is configured for these users:\n{users_wo_key}') @@ -114,7 +114,7 @@ def verify(ocserv): if "password" in ocserv["authentication"]["mode"]["local"] or "otp" not in ocserv["authentication"]["mode"]["local"]: users_wo_pswd = [] for user in ocserv["authentication"]["local_users"]["username"]: - if not "password" in ocserv["authentication"]["local_users"]["username"][user]: + if "password" not in ocserv["authentication"]["local_users"]["username"][user]: users_wo_pswd.append(user) if users_wo_pswd: raise ConfigError(f'password required for users:\n{users_wo_pswd}') @@ -194,7 +194,7 @@ def generate(ocserv): otp_type = "HOTP/T" + otp_interval ocserv["authentication"]["local_users"]["username"][user]["otp"]["token_tmpl"] = otp_type + "/" + otp_length # if there is a password, generate hash - if "password" in ocserv["authentication"]["mode"]["local"] or not "otp" in ocserv["authentication"]["mode"]["local"]: + if "password" in ocserv["authentication"]["mode"]["local"] or "otp" not in ocserv["authentication"]["mode"]["local"]: if "local_users" in ocserv["authentication"]: for user in ocserv["authentication"]["local_users"]["username"]: ocserv["authentication"]["local_users"]["username"][user]["hash"] = get_hash(ocserv["authentication"]["local_users"]["username"][user]["password"]) |