From ade516e6f80f5648594889acc9f32afb80b5f704 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Fri, 27 Oct 2023 10:56:14 +0200 Subject: Minor changes --- clusterman/commands/frontend.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'clusterman/commands/frontend.py') diff --git a/clusterman/commands/frontend.py b/clusterman/commands/frontend.py index bb930cb..f275827 100644 --- a/clusterman/commands/frontend.py +++ b/clusterman/commands/frontend.py @@ -1,6 +1,6 @@ import os, json, re from clusterman.config import CONF - +from clusterman.commands.node import get_node_in_group def info(): nodes=None @@ -20,18 +20,10 @@ def info(): # Groups print("Node groups: ",end="") if len(CONF["cluster"]["groups"]) > 0: - pattern=None + content=list() for group in CONF["cluster"]["groups"].keys(): - if not pattern == None: - print(", ", end="") - pattern = re.compile(CONF["cluster"]["groups"][group]) - count=0 - if not nodes == None: - for ip in nodes: - if pattern.match(ip): - count=count+1 - print("{}({})".format(group,count),end="") - print() + content.append("{}({})".format(group,len(get_node_in_group(group)))) + print(", ".join(content)) else: print("NA") -- cgit v1.2.3