Fix some handling of log messages from ansible-connection (#50214)

This commit is contained in:
Nathaniel Case 2018-12-20 16:38:59 -05:00 committed by GitHub
parent 069e0b8d57
commit 62ec383232
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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:
@ -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,