mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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:
parent
8c49fd2a2c
commit
1156014d9c
1 changed files with 3 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue