Fix password lock time check

This commit is contained in:
Jorge-Rodriguez 2020-11-30 12:29:16 +02:00
parent 64aae9ba08
commit bb45038ce7
No known key found for this signature in database
GPG key ID: 43153D1EFD8F7D90

View file

@ -455,7 +455,7 @@ def validate_account_locking(cursor, account_locking):
}
if any([int(value) < 0 or int(value) > 32767 for value in locking.values() if re.match("[-+]?\\d+$", value)]):
module.fail_json(msg="Account locking values are out of the valid range (0-32767)")
if not re.match("[-+]?\\d+$", locking.get("PASSWORD_LOCK_TIME", "")) and locking.get("PASSWORD_LOCK_TIME") != "UNBOUNDED":
if "PASSWORD_LOCK_TIME" in locking.keys() and not re.match("[-+]?\\d+$", locking.get("PASSWORD_LOCK_TIME")) and locking.get("PASSWORD_LOCK_TIME") != "UNBOUNDED":
module.fail_json(msg="PASSWORD_LOCK_TIME must be an integer between 0 and 32767 or 'UNBOUNDED'")
return locking