diff options
author | Peter Mikus <pmikus@cisco.com> | 2020-01-24 12:08:52 +0000 |
---|---|---|
committer | Peter Mikus <pmikus@cisco.com> | 2020-01-24 12:21:50 +0000 |
commit | eb2723bbf4f66cd9b658b220b91c800ad1beace4 (patch) | |
tree | 34413cf3fdca73576b1d680f0f5f8d4ca12789f2 /resources/libraries | |
parent | 100fee239bb1627e4d109f72e742cf7087315d31 (diff) |
Attempt to fix journalctl
- AWK
- ECHO
- pipe
+ Much simpler
Change-Id: I4876f4eae68c96571dc38fd21e53ba269f5f888e
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/libraries')
-rw-r--r-- | resources/libraries/python/DUTSetup.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/resources/libraries/python/DUTSetup.py b/resources/libraries/python/DUTSetup.py index 3f8c407313..0c0e831735 100644 --- a/resources/libraries/python/DUTSetup.py +++ b/resources/libraries/python/DUTSetup.py @@ -35,9 +35,9 @@ class DUTSetup: """ command = u"echo $(< /tmp/*supervisor*.log)"\ if DUTSetup.running_in_container(node) \ - else f"journalctl --no-pager --unit={service} " \ - f"--since=\"$(echo `systemctl show -p ActiveEnterTimestamp " \ - f"{service}` | awk \'{{print $2 $3}}\')\"" + else f"journalctl --no-pager _SYSTEMD_INVOCATION_ID=$(systemctl " \ + f"show -p InvocationID --value {service})" + message = f"Node {node[u'host']} failed to get logs from unit {service}" exec_cmd_no_error( |