mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 13:53:23 +00:00
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.
This commit is contained in:
@@ -106,6 +106,7 @@ RETURN = '''
|
||||
|
||||
|
||||
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, \
|
||||
temp_kdestroy, valid_creds, api_connect, api_command, compare_args_ipa, \
|
||||
module_params_get
|
||||
@@ -150,7 +151,7 @@ def forwarder_list(forwarders):
|
||||
formatter = "{ip_address} port {port}"
|
||||
else:
|
||||
formatter = "{ip_address}"
|
||||
fwd_list.append(formatter.format(**forwarder))
|
||||
fwd_list.append(to_text(formatter.format(**forwarder)))
|
||||
return fwd_list
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user