mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 22:03:18 +00:00
permission: Fix idempotency issues for DN parameters
The parameters - subtree (ipapermlocation) - target (ipapermtarget) - targetto (ipapermtargetto) - targetfrom (ipapermtargetfrom) have not been idempotent as the result returned from permission_show was a DN and not a string. The find_permission function has been exetended to convert the values for these parameters to strings. Fixes: #1257
This commit is contained in:
@@ -154,7 +154,7 @@ RETURN = """
|
||||
|
||||
|
||||
from ansible.module_utils.ansible_freeipa_module import \
|
||||
IPAAnsibleModule, compare_args_ipa
|
||||
IPAAnsibleModule, compare_args_ipa, to_text
|
||||
|
||||
|
||||
def find_permission(module, name):
|
||||
@@ -164,7 +164,12 @@ def find_permission(module, name):
|
||||
except Exception: # pylint: disable=broad-except
|
||||
# An exception is raised if permission name is not found.
|
||||
return None
|
||||
return _result["result"]
|
||||
_res = _result["result"]
|
||||
for param in ["ipapermlocation", "ipapermtarget", "ipapermtargetto",
|
||||
"ipapermtargetfrom"]:
|
||||
if param in _res:
|
||||
_res[param] = [to_text(elem) for elem in _res[param]]
|
||||
return _res
|
||||
|
||||
|
||||
def gen_args(right, attrs, bindtype, subtree,
|
||||
|
||||
Reference in New Issue
Block a user