diff options
author | Nathaniel Case <this.is@nathanielca.se> | 2018-12-21 10:31:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-21 10:31:43 -0500 |
commit | b2423e7602b66d7cdcee85c07bbcad14928aa120 (patch) | |
tree | bb4234990de4f10ef48fa3f94a09d1cf26e703e6 /bin | |
parent | c093ea5a28d69bfe1e2f02b9f10f0cfd1a7da492 (diff) | |
download | ansible-b2423e7602b66d7cdcee85c07bbcad14928aa120.tar.gz |
Log device interaction and push labeled logs back to controller (#50028)
* Add session tracing support for network_cli, netconf and httapi connection
* Add `persistent_log_messages` configuration option to log device inteaction
in log file for network_cli, netconf and httapi connection
type
* Log jsonrpc request and response in log file is configuration option
is enabled
* Update docs to talk about warning shown when persistent_log_messages is on
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ansible-connection | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/ansible-connection b/bin/ansible-connection index 36d2257621..7f35aa981e 100755 --- a/bin/ansible-connection +++ b/bin/ansible-connection @@ -131,17 +131,18 @@ class ConnectionProcess(object): self.exception = None (s, addr) = self.sock.accept() signal.alarm(0) - signal.signal(signal.SIGALRM, self.command_timeout) while True: data = recv_data(s) if not data: break + self.connection._log_messages("jsonrpc request: %s" % data) signal.alarm(self.connection.get_option('persistent_command_timeout')) resp = self.srv.handle_request(data) signal.alarm(0) + self.connection._log_messages("jsonrpc response: %s" % resp) send_data(s, to_bytes(resp)) s.close() |