summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn R Barker <john@johnrbarker.com>2017-05-09 14:06:28 +0100
committerGitHub <noreply@github.com>2017-05-09 14:06:28 +0100
commit15f635f7c3bec25b81255114809e2cefd9feb96d (patch)
treeba8ead6d6d167c21dedfbdfae4ff0dae4d8b2b5a
parentb87ffb2082c8c6ee9f8960761120b5e82faf8c9b (diff)
downloadansible-15f635f7c3bec25b81255114809e2cefd9feb96d.tar.gz
Reference correct variable and key for role expiry (#23397) (#24405)
Previously, this module could throw the following error message: NameError: global name 'current_roles_attrs' is not defined The referencing key should also match the name of the column, which is rolvaliduntil, not rol_valid_until (cherry picked from commit c5adf08c40db740e1481130b97c206ab371b31d0)
-rw-r--r--lib/ansible/modules/database/postgresql/postgresql_user.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/modules/database/postgresql/postgresql_user.py b/lib/ansible/modules/database/postgresql/postgresql_user.py
index 977e64bd80..9e5b578f78 100644
--- a/lib/ansible/modules/database/postgresql/postgresql_user.py
+++ b/lib/ansible/modules/database/postgresql/postgresql_user.py
@@ -314,7 +314,7 @@ def user_alter(cursor, module, user, password, role_attr_flags, encrypted, expir
if current_role_attrs[PRIV_TO_AUTHID_COLUMN[role_attr_name]] != role_attr_value:
role_attr_flags_changing = True
- expires_changing = (expires is not None and expires == current_roles_attrs['rol_valid_until'])
+ expires_changing = (expires is not None and expires == current_role_attrs['rolvaliduntil'])
if not pwchanging and not role_attr_flags_changing and not expires_changing:
return False