From d971dd23a4143545945c00a1bc280a941e76b80a Mon Sep 17 00:00:00 2001 From: Gustavo Muniz do Carmo Date: Mon, 6 Aug 2018 10:31:08 +0100 Subject: [PATCH] ldap_entry bugfix (#43620) --- lib/ansible/modules/net_tools/ldap/ldap_entry.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/net_tools/ldap/ldap_entry.py b/lib/ansible/modules/net_tools/ldap/ldap_entry.py index ebc4a969e77..03a866ce19f 100644 --- a/lib/ansible/modules/net_tools/ldap/ldap_entry.py +++ b/lib/ansible/modules/net_tools/ldap/ldap_entry.py @@ -110,7 +110,7 @@ import traceback from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six import string_types -from ansible.module_utils._text import to_native +from ansible.module_utils._text import to_native, to_bytes from ansible.module_utils.ldap import LdapGeneric, gen_specs try: @@ -145,9 +145,9 @@ class LdapEntry(LdapGeneric): attrs[name] = [] if isinstance(value, list): - attrs[name] = value + attrs[name] = [map(to_bytes, value)] else: - attrs[name].append(str(value)) + attrs[name].append(to_bytes(value)) return attrs