diff --git a/roles/ldap_server/library/ldap_entry.py b/roles/ldap_server/library/ldap_entry.py index 73746697d7f2ee6eff75c051f4f2cb8904bab407..51720acfb5ee0b107541337d8efad61ab0b4e7f7 100755 --- a/roles/ldap_server/library/ldap_entry.py +++ b/roles/ldap_server/library/ldap_entry.py @@ -261,12 +261,7 @@ def main(): module.params["bind_dn"], module.params["bind_password"]) except ldap.LDAPError as e: - if e.info: - error_message = "%s: %s" % (e.desc, e.info) - else: - error_message = "%s" % e.desc - - module.fail_json(msg=error_message) + module.fail_json(msg="LDAP error: %s" % str(e)) entry = LDAPEntry(module.params["dn"], attributes, @@ -279,7 +274,7 @@ def main(): else: changed = entry.remove() except ldap.LDAPError as e: - module.fail_json(msg=str(e)) + module.fail_json(msg="LDAP error: %s" % str(e)) module.exit_json(changed=changed)