Skip to content

Commit

Permalink
Fix some handling of log messages from ansible-connection (ansible#50214
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Qalthos authored Dec 20, 2018
1 parent 069e0b8 commit 62ec383
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/ansible-connection
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ class ConnectionProcess(object):
self.sock.listen(1)
messages.append(('vvvv', 'local domain socket listeners started successfully'))
except Exception as exc:
messages.extend(self.connection.pop_messages())
result['error'] = to_text(exc)
result['exception'] = traceback.format_exc()
finally:
Expand Down Expand Up @@ -304,7 +305,8 @@ def main():
'exception': traceback.format_exc()
})

messages.extend(Connection(socket_path).pop_messages())
if os.path.exists(socket_path):
messages.extend(Connection(socket_path).pop_messages())
messages.append(('vvvv', sys.stdout.getvalue()))
result.update({
'messages': messages,
Expand Down

0 comments on commit 62ec383

Please sign in to comment.