This commit is contained in:
Mateusz Gruszczyński
2025-10-17 14:26:17 +02:00
parent 9a21739eb9
commit 38e5fc6e49
5 changed files with 664 additions and 489 deletions

6
app.py
View File

@@ -291,10 +291,6 @@ def node_ha_services(node: str) -> Dict[str, str]:
return {"crm_state": one("pve-ha-crm"), "lrm_state": one("pve-ha-lrm")}
def units_for_node(node: str) -> Dict[str, str]:
"""
Preferuj /nodes/<node>/services. Normalizuj nazwy (bez .service)
i mapuj różne pola na 'active'/'inactive'.
"""
wanted = {"watchdog-mux", "pve-ha-crm", "pve-ha-lrm"}
svc = get_json(["pvesh", "get", f"/nodes/{node}/services"]) or []
states: Dict[str, str] = {}
@@ -438,7 +434,7 @@ def api_disable():
if __name__ == "__main__":
import argparse
p = argparse.ArgumentParser()
p.add_argument("--bind", default="127.0.0.1:8088", help="addr:port")
p.add_argument("--bind", default="127.0.0.1:8007", help="addr:port")
p.add_argument("--node", default=DEFAULT_NODE, help="default node")
args = p.parse_args()
DEFAULT_NODE = args.node