summaryrefslogtreecommitdiff
path: root/clusterman/commands
diff options
context:
space:
mode:
authorLoic Guegan <loic.guegan@mailbox.org>2023-10-26 16:57:30 +0200
committerLoic Guegan <loic.guegan@mailbox.org>2023-10-26 16:57:30 +0200
commitf741c9863db3acbe5f35b14ba2195537c9674731 (patch)
treee095bd70e133ac56fa5269c1624ec764c1f8a0e6 /clusterman/commands
parentabd29e2cdfe83160869631a0f391d428bbe11210 (diff)
Minor changes
Diffstat (limited to 'clusterman/commands')
-rw-r--r--clusterman/commands/frontend.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/clusterman/commands/frontend.py b/clusterman/commands/frontend.py
new file mode 100644
index 0000000..bcd4ab7
--- /dev/null
+++ b/clusterman/commands/frontend.py
@@ -0,0 +1,25 @@
+import os, json
+from clusterman.config import CONF
+
+
+
+
+def info():
+ nodes=None
+ if os.path.exists(CONF.NODE_FILE):
+ with open(CONF.NODE_FILE) as f:
+ nodes=json.load(f)
+
+ 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))
+
+ # Cache
+ print("Last node scan: ",end="")
+ if cache!=None and "last_scan" in CONF["cache"]:
+ print(CONF["cache"]["last_scan"])