summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Kocialkowski2023-11-16 21:32:32 +0100
committerPaul Kocialkowski2023-11-16 21:32:32 +0100
commit8d9fb3307b6497c277f5c92ad51207ee9f3444b8 (patch)
tree0ffed8f671c21ccf36fb3799b74a6b98760896c4
parentc154831c42d734a14074a1d29c4534b4325b0a99 (diff)
host-control: Refactor unit-log
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rwxr-xr-xhost-control7
1 files changed, 3 insertions, 4 deletions
diff --git a/host-control b/host-control
index b4c1e9b..4fb6014 100755
--- a/host-control
+++ b/host-control
@@ -335,13 +335,12 @@ class host_control():
self.print_message("No " + name + " unit in host: " + self.host)
return 1
- if not "systemd-unit" in unit:
- return 1
-
if "log-path" in unit:
arguments = [ "tail", "-n", "50", "-f", unit["log-path"] ]
- else:
+ elif "systemd-unit" in unit:
arguments = [ "journalctl", "-n", "50", "-fu", unit["systemd-unit"] ]
+ else:
+ return 1
self.host_call(host, arguments)