From bc44175d8dd288af7c940fa060ab4e1b90f3737e Mon Sep 17 00:00:00 2001 From: Victor Perron Date: Wed, 29 Mar 2017 15:02:28 +0200 Subject: [PATCH] paramiko_ssh: fix crash upon pass prompt in py3 The pass prompt expects an answer and compares a `str` to a binary buffer, thus crashing. It's an obvious fix to help transitioning towards Python3 and hopes it does not need a specific test. --- lib/ansible/plugins/connection/paramiko_ssh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/connection/paramiko_ssh.py b/lib/ansible/plugins/connection/paramiko_ssh.py index 9aa581183ee..7eb8b5799f1 100644 --- a/lib/ansible/plugins/connection/paramiko_ssh.py +++ b/lib/ansible/plugins/connection/paramiko_ssh.py @@ -302,7 +302,7 @@ class Connection(ConnectionBase): chunk = chan.recv(bufsize) display.debug("chunk is: %s" % chunk) if not chunk: - if 'unknown user' in become_output: + if b'unknown user' in become_output: raise AnsibleError( 'user %s does not exist' % self._play_context.become_user) else: break