From c8fd8bc37e10e14d91eaa88a479692513f92ac72 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 3 Aug 2026 12:47:32 +0000 Subject: [PATCH] fix: status parsing from systemd list-units --- python/deploy.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/python/deploy.py b/python/deploy.py index c735659..ae3725b 100644 --- a/python/deploy.py +++ b/python/deploy.py @@ -218,18 +218,19 @@ def remove_node(name): # ─── Status ──────────────────────────────────────────────────────────── def show_status(): - # Check systemd for running instances if state is empty r = run("systemctl list-units 'wallarm-node@*' --no-legend 2>/dev/null") if not r.stdout.strip(): print("No nodes running.") return print("\n─── Node Status ───") for line in r.stdout.strip().split("\n"): + # Parse: "wallarm-node@srv1.service loaded active running ..." parts = line.split() - if len(parts) >= 4: - name = parts[0].replace("wallarm-node@", "").replace(".service", "") - status = "●" if parts[3] == "running" else "○" - print(f" {status} {name} — {parts[3]}") + if len(parts) >= 4 and '@' in parts[0]: + name = parts[0].split('@')[1].replace(".service", "") + active = parts[3] if len(parts) > 3 else "unknown" + status = "●" if active == "active" or active == "running" else "○" + print(f" {status} {name} — {active}") # ─── Tunnel ────────────────────────────────────────────────────────────