summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <loic.guegan@mailbox.org>2023-10-31 16:30:19 +0100
committerLoic Guegan <loic.guegan@mailbox.org>2023-10-31 16:30:19 +0100
commit9d1fe3b046787d35a7030c2dbb1391b7ac398d49 (patch)
tree56a3c0de9a2e9414c2152ec28f1c574edacade63
parented8337414c35771fabb8334a7c95decfa6bd762c (diff)
Minor changes
-rw-r--r--clusterman/commands/node.py5
-rw-r--r--clusterman/utils.py2
2 files changed, 3 insertions, 4 deletions
diff --git a/clusterman/commands/node.py b/clusterman/commands/node.py
index 1b5a2ed..fba42ec 100644
--- a/clusterman/commands/node.py
+++ b/clusterman/commands/node.py
@@ -4,7 +4,6 @@ import clusterman.utils as utils
def ls(group=None):
- nodes_path=CONF.NODE_FILE
nodes=utils.get_node_list()
if len(nodes)<=0:
print("Please perform a scan before")
@@ -21,7 +20,7 @@ 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(".")]
ignore_list=[ip.strip(" ") for ip in CONF["cluster"]["ip4_ignore"]]
- nodes=list()
+ nodes=dict()
print("----- Starting node scan (timeout={}s) -----".format(timeout))
for W in range(from_split[0],to_split[0]+1):
for X in range(from_split[1],to_split[1]+1):
@@ -33,7 +32,7 @@ def scan(timeout):
continue
print("Contacting {}...".format(ip),end='')
if not utils.ping_test(ip):
- nodes.append(ip)
+ nodes[ip]={"hostname":""}
print("=> Found!!")
else:
print()
diff --git a/clusterman/utils.py b/clusterman/utils.py
index 5fa66b2..2ab37f0 100644
--- a/clusterman/utils.py
+++ b/clusterman/utils.py
@@ -26,7 +26,7 @@ def get_node_list():
if os.path.exists(nodes_path):
with open(nodes_path) as f:
nodes=json.load(f)
- return nodes
+ return nodes.keys()
return list()
def get_node_in_group(group):