diff options
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") |
