Fix regression in synchronize when using ssh passwords

The change to add sshpass support for rsync broke synchronize when
a password was provided at all.  Have to convert an int into a string to
make it work.
pull/48135/head
Toshio Kuratomi 6 years ago
parent 8c49fd2a2c
commit 1156014d9c

@ -321,7 +321,8 @@ EXAMPLES = '''
import os import os
import errno import errno
from ansible.module_utils.basic import AnsibleModule, to_bytes from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils._text import to_bytes, to_native
from ansible.module_utils.six.moves import shlex_quote from ansible.module_utils.six.moves import shlex_quote
@ -440,7 +441,7 @@ def main():
msg="to use rsync connection with passwords, you must install the sshpass program" msg="to use rsync connection with passwords, you must install the sshpass program"
) )
_sshpass_pipe = os.pipe() _sshpass_pipe = os.pipe()
cmd = ['sshpass', '-d' + _sshpass_pipe[0]] + cmd cmd = ['sshpass', '-d' + to_native(_sshpass_pipe[0], errors='surrogate_or_strict')] + cmd
if compress: if compress:
cmd.append('--compress') cmd.append('--compress')
if rsync_timeout: if rsync_timeout:

Loading…
Cancel
Save