compatibilidad python3
This commit is contained in:
parent
da55eec420
commit
888bba7397
@ -197,7 +197,7 @@ class ActionModule(ActionBase):
|
|||||||
else:
|
else:
|
||||||
raise AnsibleError('Unknown encoding returned from slurp, this is a bug.')
|
raise AnsibleError('Unknown encoding returned from slurp, this is a bug.')
|
||||||
except AnsibleError as e:
|
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.write(u'\n\n')
|
||||||
ldif_content.seek(0)
|
ldif_content.seek(0)
|
||||||
@ -226,10 +226,10 @@ class ActionModule(ActionBase):
|
|||||||
failed = False if result['rc'] in (0, 32) else result.get('failed',False)
|
failed = False if result['rc'] in (0, 32) else result.get('failed',False)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise LDAPException("Failed command: {}, message: {}".format(
|
raise LDAPException("Failed command: {}, message: {}".format(
|
||||||
command, e.message))
|
command, str(e)))
|
||||||
if failed:
|
if failed:
|
||||||
raise LDAPException("Failed command: {}, message: {}".format(
|
raise LDAPException("Failed command: {}, message: {}".format(
|
||||||
command, result['stderr']))
|
command, result.get('stderr','(no stderr)')))
|
||||||
result['failed'] = failed
|
result['failed'] = failed
|
||||||
return result
|
return result
|
||||||
|
|
||||||
@ -482,7 +482,7 @@ class ActionModule(ActionBase):
|
|||||||
except LDAPException as e:
|
except LDAPException as e:
|
||||||
return merge_hash( self.result, {
|
return merge_hash( self.result, {
|
||||||
'failed': True,
|
'failed': True,
|
||||||
'msg': "Invalid arguments: {}".format(e.message)
|
'msg': "Invalid arguments: {}".format(str(e))
|
||||||
})
|
})
|
||||||
|
|
||||||
self.result['dn'] = self.dn
|
self.result['dn'] = self.dn
|
||||||
|
Loading…
x
Reference in New Issue
Block a user