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.
This commit is contained in:
Toshio Kuratomi 2018-11-05 13:30:56 -08:00
parent 8c49fd2a2c
commit 1156014d9c

View file

@ -321,7 +321,8 @@ EXAMPLES = '''
import os
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
@ -440,7 +441,7 @@ def main():
msg="to use rsync connection with passwords, you must install the sshpass program"
)
_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:
cmd.append('--compress')
if rsync_timeout: