diff options
| author | Loic Guegan <loic.guegan@mailbox.org> | 2023-10-27 12:37:05 +0200 |
|---|---|---|
| committer | Loic Guegan <loic.guegan@mailbox.org> | 2023-10-27 12:37:05 +0200 |
| commit | f8d4827e49c5066c6a604a1bdb43406e4388f929 (patch) | |
| tree | 03e9c4223595b79785cabc2e1d67638215e5d6e2 /clusterman/commands/frontend.py | |
| parent | be63ecd7dcd86480b7d134c0b281d5a3160531eb (diff) | |
Minor changes
Diffstat (limited to 'clusterman/commands/frontend.py')
| -rw-r--r-- | clusterman/commands/frontend.py | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/clusterman/commands/frontend.py b/clusterman/commands/frontend.py index f275827..4d7ecc4 100644 --- a/clusterman/commands/frontend.py +++ b/clusterman/commands/frontend.py @@ -1,28 +1,24 @@ import os, json, re +from datetime import datetime from clusterman.config import CONF -from clusterman.commands.node import get_node_in_group +import clusterman.commands.node as node def info(): - nodes=None - if os.path.exists(CONF.NODE_FILE): - with open(CONF.NODE_FILE) as f: - nodes=json.load(f) - + nodes=node.get_node_list() cache=None if os.path.exists(CONF.CACHE_FILE): with open(CONF.CACHE_FILE) as f: cache=json.load(f) # Node - print("Node count: ",end="") - print("NA") if nodes==None else print(len(nodes)) + print("Node count: "+str(len(nodes))) # Groups print("Node groups: ",end="") if len(CONF["cluster"]["groups"]) > 0: content=list() for group in CONF["cluster"]["groups"].keys(): - content.append("{}({})".format(group,len(get_node_in_group(group)))) + content.append("{}({})".format(group,len(node.get_node_in_group(group)))) print(", ".join(content)) else: print("NA") @@ -31,7 +27,8 @@ def info(): # Cache print("Last node scan: ",end="") if cache!=None and "last_scan" in CONF["cache"]: - print(CONF["cache"]["last_scan"]) + dt=datetime.fromtimestamp(int(CONF["cache"]["last_scan"]), tz=None) + print(dt) else: print("NA") |
