Attempt to fix journalctl
[csit.git] / resources / libraries / python / DUTSetup.py
index 3f8c407..0c0e831 100644 (file)
@@ -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(