1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

checks connected property to validate connection in Server (#20695)

fixes #20693
This commit is contained in:
Peter Sprygada 2017-01-26 09:30:38 -05:00 committed by John R Barker
parent 614390a310
commit d668d53112

View file

@ -120,8 +120,8 @@ class Server():
self._start_time = datetime.datetime.now() self._start_time = datetime.datetime.now()
self.conn = connection_loader.get(play_context.connection, play_context, sys.stdin) self.conn = connection_loader.get(play_context.connection, play_context, sys.stdin)
rc, out, err = self.conn._connect() self.conn._connect()
if rc != 0: if not self.conn.connected:
raise AnsibleConnectionFailure(err) raise AnsibleConnectionFailure(err)
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)