summaryrefslogtreecommitdiff
path: root/clusterman/commands
diff options
context:
space:
mode:
authorLoic Guegan <loic.guegan@mailbox.org>2023-10-27 14:18:57 +0200
committerLoic Guegan <loic.guegan@mailbox.org>2023-10-27 14:18:57 +0200
commit28c1833601f433d5b5dee840192a7bb4c3d36f4d (patch)
tree19e50a9d5638bde16c7243e295157268043999a1 /clusterman/commands
parenteb41b0b49a4d698bb264e5f7e280d8349eba2344 (diff)
Minor changes
Diffstat (limited to 'clusterman/commands')
-rw-r--r--clusterman/commands/node.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/clusterman/commands/node.py b/clusterman/commands/node.py
index 6a32fb1..59fbdc5 100644
--- a/clusterman/commands/node.py
+++ b/clusterman/commands/node.py
@@ -83,10 +83,11 @@ def check(timeout):
else:
print("Error: Some of your nodes are not reachable")
-def exec(command):
+def exec(command, group=None):
user="root" if len(CONF["ssh"]["user"]) <= 0 else CONF["ssh"]["user"]
key_path=CONF["ssh"]["key_path"]
- for ip in get_node_list():
+ nodes=get_node_list() if group is None else get_node_in_group(group)
+ for ip in nodes:
print("----- Node {} -----".format(ip))
if len(key_path)>0:
output=subprocess.check_output(["ssh","-o", "StrictHostKeyChecking=no", "-i", CONF["ssh"]["key_path"],"{}@{}".format(user,ip), " ".join(command)])