Skip to content
Snippets Groups Projects
Unverified Commit 14d45020 authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman Committed by GitHub
Browse files

Merge pull request #261 from t-woerner/ipauser_encode_certificates

ipauser: Use encode_certificate for certificates in  find_user result
parents b0a067d5 791c4703
No related branches found
No related tags found
No related merge requests found
...@@ -467,7 +467,7 @@ from ansible.module_utils._text import to_text ...@@ -467,7 +467,7 @@ from ansible.module_utils._text import to_text
from ansible.module_utils.ansible_freeipa_module import temp_kinit, \ from ansible.module_utils.ansible_freeipa_module import temp_kinit, \
temp_kdestroy, valid_creds, api_connect, api_command, date_format, \ temp_kdestroy, valid_creds, api_connect, api_command, date_format, \
compare_args_ipa, module_params_get, api_check_param, api_get_realm, \ compare_args_ipa, module_params_get, api_check_param, api_get_realm, \
api_command_no_name, gen_add_del_lists api_command_no_name, gen_add_del_lists, encode_certificate
import six import six
...@@ -497,6 +497,11 @@ def find_user(module, name, preserved=False): ...@@ -497,6 +497,11 @@ def find_user(module, name, preserved=False):
for x in _result["krbprincipalname"]: for x in _result["krbprincipalname"]:
_list.append(str(x)) _list.append(str(x))
_result["krbprincipalname"] = _list _result["krbprincipalname"] = _list
certs = _result.get("usercertificate")
if certs is not None:
_result["usercertificate"] = [encode_certificate(x)
for x in certs]
return _result return _result
else: else:
return None return None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment