summaryrefslogtreecommitdiff
path: root/clusterman/commands
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-10-29 09:46:58 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2023-10-29 09:46:58 +0100
commited8337414c35771fabb8334a7c95decfa6bd762c (patch)
tree2b69e0ce803d3e9d1e970feb3addfe9c4ea675de /clusterman/commands
parentf4da1431425bb83e14f199ddd06896165182a0df (diff)
Minor changes
Diffstat (limited to 'clusterman/commands')
-rw-r--r--clusterman/commands/node.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/clusterman/commands/node.py b/clusterman/commands/node.py
index 4d7b762..1b5a2ed 100644
--- a/clusterman/commands/node.py
+++ b/clusterman/commands/node.py
@@ -32,11 +32,10 @@ def scan(timeout):
print("Skipping {}".format(ip))
continue
print("Contacting {}...".format(ip),end='')
- try:
- subprocess.run(["ping", "-c", "1", "-W", str(timeout), ip],capture_output=True,check=True)
+ if not utils.ping_test(ip):
nodes.append(ip)
print("=> Found!!")
- except:
+ else:
print()
with open(CONF.NODE_FILE, "w") as f:
f.write(json.dumps(nodes,indent=4))
@@ -52,10 +51,9 @@ def check(timeout):
fail=False
for ip in nodes:
print("Contacting {}...".format(ip),end='')
- try:
- subprocess.run(["ping", "-c", "1", "-W", str(timeout), ip],capture_output=True,check=True)
+ if not utils.ping_test(ip,timeout):
print()
- except:
+ else:
fail=True
print("=> Not responding!!")
if not fail: