From 9ee206547785b3e5c707d471cba1c6972974f08f 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. (cherry picked from commit bc44175d8dd288af7c940fa060ab4e1b90f3737e) --- 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 790d1a22c14..a0c0e09fd0b 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