summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-10-27 09:12:28 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2023-10-27 09:12:28 +0200
commitcad597868f88fb783a94c8d0bb169d0540d1f32e (patch)
tree784c7aaee94a890187f1c7f18453ed67dcacfc66
parent01fd3c2d66f88172027d4cf38232e358ac0ff3a5 (diff)
Minor changes
-rw-r--r--clusterman/commands/frontend.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/clusterman/commands/frontend.py b/clusterman/commands/frontend.py
index 26d4409..963357b 100644
--- a/clusterman/commands/frontend.py
+++ b/clusterman/commands/frontend.py
@@ -1,9 +1,7 @@
-import os, json
+import os, json, re
from clusterman.config import CONF
-
-
def info():
nodes=None
if os.path.exists(CONF.NODE_FILE):
@@ -22,7 +20,17 @@ def info():
# Groups
print("Node groups: ",end="")
if len(CONF["cluster"]["groups"]) > 0:
- print(",".join(CONF["cluster"]["groups"].keys()))
+ pattern=None
+ for group in CONF["cluster"]["groups"].keys():
+ if not pattern == None:
+ print(", ", end="")
+ pattern = re.compile(CONF["cluster"]["groups"][group])
+ count=0
+ for ip in nodes:
+ if pattern.match(ip):
+ count=count+1
+ print("{}({})".format(group,count),end="")
+ print()
else:
print("NA")