From eb2723bbf4f66cd9b658b220b91c800ad1beace4 Mon Sep 17 00:00:00 2001 From: Peter Mikus Date: Fri, 24 Jan 2020 12:08:52 +0000 Subject: Attempt to fix journalctl - AWK - ECHO - pipe + Much simpler Change-Id: I4876f4eae68c96571dc38fd21e53ba269f5f888e Signed-off-by: Peter Mikus --- resources/libraries/python/DUTSetup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'resources/libraries/python') 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( -- cgit 1.2.3-korg