aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2020-01-24 12:08:52 +0000
committerPeter Mikus <pmikus@cisco.com>2020-01-24 12:23:34 +0000
commitee35bd761267fb204387cbe996ab05bc2825d917 (patch)
treea2e99189fc0e602658b7be3bd8d2960a535587f2 /resources/libraries
parent555088333f7c4a87e6346269f324bbabd5e3a8ae (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.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/resources/libraries/python/DUTSetup.py b/resources/libraries/python/DUTSetup.py
index 431ccfb8ae..49c3d41062 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(