From f41a9ce08b99c6db321be0462f3532ccc48dfcac Mon Sep 17 00:00:00 2001 From: Jorge-Rodriguez Date: Mon, 30 Nov 2020 10:25:14 +0200 Subject: [PATCH] Fix key error --- plugins/modules/mysql_user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/mysql_user.py b/plugins/modules/mysql_user.py index 3930165..e71b658 100644 --- a/plugins/modules/mysql_user.py +++ b/plugins/modules/mysql_user.py @@ -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["PASSWORD_LOCK_TIME"]) and locking["PASSWORD_LOCK_TIME"] != "UNBOUNDED": + if 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