summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Sprygada <privateip@users.noreply.github.com>2017-01-26 09:30:38 -0500
committerJohn R Barker <john@johnrbarker.com>2017-01-26 14:30:38 +0000
commitd668d53112cbb57d812dfff46f7e93fae033d42b (patch)
treefaf9234078dc9ca040b6a2876fea08ab27cedaec
parent614390a310a0631d946cc83f386390a475e12189 (diff)
downloadansible-d668d53112cbb57d812dfff46f7e93fae033d42b.tar.gz
checks connected property to validate connection in Server (#20695)
fixes #20693
-rwxr-xr-xbin/ansible-connection4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/ansible-connection b/bin/ansible-connection
index d15962e3e1..c198478570 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)