From 8d9fb3307b6497c277f5c92ad51207ee9f3444b8 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Thu, 16 Nov 2023 21:32:32 +0100 Subject: host-control: Refactor unit-log Signed-off-by: Paul Kocialkowski --- host-control | 7 +++---- 1 file 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) -- cgit v1.2.3