Fix paramiko for non-ascii become password

Cherry-picked from a part of f24c10c32b
This commit is contained in:
Toshio Kuratomi 2016-10-15 16:29:54 -07:00
parent 264b33da6b
commit 4ea3cd3a38

View file

@ -308,7 +308,7 @@ class Connection(ConnectionBase):
if passprompt:
if self._play_context.become and self._play_context.become_pass:
chan.sendall(self._play_context.become_pass + '\n')
chan.sendall(to_bytes(self._play_context.become_pass, errors='strict') + b'\n')
else:
raise AnsibleError("A password is reqired but none was supplied")
else: