From d668d53112cbb57d812dfff46f7e93fae033d42b Mon Sep 17 00:00:00 2001 From: Peter Sprygada Date: Thu, 26 Jan 2017 09:30:38 -0500 Subject: [PATCH] checks connected property to validate connection in Server (#20695) fixes #20693 --- bin/ansible-connection | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ansible-connection b/bin/ansible-connection index d15962e3e16..c1984785706 100755 --- a/bin/ansible-connection +++ b/bin/ansible-connection @@ -120,8 +120,8 @@ class Server(): self._start_time = datetime.datetime.now() self.conn = connection_loader.get(play_context.connection, play_context, sys.stdin) - rc, out, err = self.conn._connect() - if rc != 0: + self.conn._connect() + if not self.conn.connected: raise AnsibleConnectionFailure(err) self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)