1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Reference correct variable and key for role expiry (#23397)

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
This commit is contained in:
Feike Steenbergen 2017-05-09 15:03:22 +02:00 committed by John R Barker
parent a255cfd22a
commit c5adf08c40

View file

@ -321,7 +321,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: if current_role_attrs[PRIV_TO_AUTHID_COLUMN[role_attr_name]] != role_attr_value:
role_attr_flags_changing = True 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: if not pwchanging and not role_attr_flags_changing and not expires_changing:
return False return False