From 888bba73970b9c7ae1900f9f913aedffc132818f Mon Sep 17 00:00:00 2001 From: Mauro Torrez Date: Sat, 25 May 2019 18:03:14 -0300 Subject: [PATCH] compatibilidad python3 --- action_plugins/ldap.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/action_plugins/ldap.py b/action_plugins/ldap.py index 5e6cde3..47e1368 100644 --- a/action_plugins/ldap.py +++ b/action_plugins/ldap.py @@ -197,7 +197,7 @@ class ActionModule(ActionBase): else: raise AnsibleError('Unknown encoding returned from slurp, this is a bug.') except AnsibleError as e: - raise AnsibleActionFail('Error reading remote file: {}'.format(e.message)) + raise AnsibleActionFail('Error reading remote file: {}'.format(str(e))) ldif_content.write(u'\n\n') ldif_content.seek(0) @@ -226,10 +226,10 @@ class ActionModule(ActionBase): failed = False if result['rc'] in (0, 32) else result.get('failed',False) except Exception as e: raise LDAPException("Failed command: {}, message: {}".format( - command, e.message)) + command, str(e))) if failed: raise LDAPException("Failed command: {}, message: {}".format( - command, result['stderr'])) + command, result.get('stderr','(no stderr)'))) result['failed'] = failed return result @@ -482,7 +482,7 @@ class ActionModule(ActionBase): except LDAPException as e: return merge_hash( self.result, { 'failed': True, - 'msg': "Invalid arguments: {}".format(e.message) + 'msg': "Invalid arguments: {}".format(str(e)) }) self.result['dn'] = self.dn