diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2023-10-27 10:56:14 +0200 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2023-10-27 10:56:14 +0200 |
| commit | ade516e6f80f5648594889acc9f32afb80b5f704 (patch) | |
| tree | 20e9272c3ed1338fcf0cd6aa7723b7cfabea0166 /clusterman/commands/frontend.py | |
| parent | 37ac5a14dda2def4851122898ba3fd9acd690249 (diff) | |
Minor changes
Diffstat (limited to 'clusterman/commands/frontend.py')
| -rw-r--r-- | clusterman/commands/frontend.py | 16 |
1 files changed, 4 insertions, 12 deletions
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") |
