Skip to content
Snippets Groups Projects
Commit 366e023d authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

Fix invalid forwarder list due to not using Unicode text.

When using ipadnsfowardzone with a target host that uses Python 2,
it fails to add new zones due to unicode and str being different on
that version. This patch fixes this behavior ensuring the module
works on both Python verisons 2.7 and 3.x.
parent c2f68a34
Branches
Tags
No related merge requests found
...@@ -106,6 +106,7 @@ RETURN = ''' ...@@ -106,6 +106,7 @@ RETURN = '''
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
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, compare_args_ipa, \ temp_kdestroy, valid_creds, api_connect, api_command, compare_args_ipa, \
module_params_get module_params_get
...@@ -150,7 +151,7 @@ def forwarder_list(forwarders): ...@@ -150,7 +151,7 @@ def forwarder_list(forwarders):
formatter = "{ip_address} port {port}" formatter = "{ip_address} port {port}"
else: else:
formatter = "{ip_address}" formatter = "{ip_address}"
fwd_list.append(formatter.format(**forwarder)) fwd_list.append(to_text(formatter.format(**forwarder)))
return fwd_list return fwd_list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment