From 068fba04843a8e1a9a96c13211f98a89c39100a5 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Thu, 26 Oct 2023 15:34:04 +0200 Subject: Minor changes --- clusterman/commands/node.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'clusterman/commands/node.py') diff --git a/clusterman/commands/node.py b/clusterman/commands/node.py index 280cb2e..a04b1a7 100644 --- a/clusterman/commands/node.py +++ b/clusterman/commands/node.py @@ -3,7 +3,7 @@ from clusterman.config import CONF def ls(): - nodes_path=CONF["paths"]["nodes"] + nodes_path=CONF.NODE_FILE nodes=None if os.path.exists(nodes_path): with open(nodes_path) as f: @@ -14,7 +14,6 @@ def ls(): for node in nodes: print(node) - def scan(timeout): from_split=[int(n) for n in CONF["cluster"]["ip4_from"].split(".")] to_split=[int(n) for n in CONF["cluster"]["ip4_to"].split(".")] @@ -36,13 +35,13 @@ def scan(timeout): print("=> Found!!") else: print("") - with open(CONF["paths"]["nodes"], "w") as f: + with open(CONF.NODE_FILE, "w") as f: f.write(json.dumps(nodes,indent=4)) - CONF["cluster"]["last_scan"]=int(time.time()) + CONF["cache"]["last_scan"]=int(time.time()) CONF.save() def check(timeout): - nodes_path=CONF["paths"]["nodes"] + nodes_path=CONF.NODE_FILE nodes=None if os.path.exists(nodes_path): with open(nodes_path) as f: -- cgit v1.2.3