diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-11-20 21:09:23 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-11-20 21:09:23 +0100 |
| commit | c217ff5e7b4d9be35e604d000506d2c60d52bd59 (patch) | |
| tree | 376a0972729fd1ecebfd419edc93e5c99f9ed6d4 | |
| parent | c23a43fb31f902d8267b7ced1097c5619959bbc5 (diff) | |
Minor changes
| -rw-r--r-- | clusterman/__main__.py | 5 | ||||
| -rw-r--r-- | clusterman/commands/node.py | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/clusterman/__main__.py b/clusterman/__main__.py index be2ea22..1d1bdad 100644 --- a/clusterman/__main__.py +++ b/clusterman/__main__.py @@ -21,6 +21,7 @@ def main(): # Exec node_cmd_list=node_subparsers.add_parser("exec") node_cmd_list.add_argument("-g", "--group" ,help="Group to run the command on") + node_cmd_list.add_argument("-l", "--login" ,help="Use ssh username and password") node_cmd_list.add_argument("cmd",help="Command to run",nargs=argparse.REMAINDER) ##### Frontend commands ##### @@ -60,9 +61,9 @@ def main(): node.ls() elif args.command == "exec": if args.group: - node.exec(args.cmd,args.group) + node.exec(args.cmd,args.group,args.login) else: - node.exec(args.cmd) + node.exec(args.cmd,args.login) else: target_node.print_help(sys.stderr) sys.exit(1) diff --git a/clusterman/commands/node.py b/clusterman/commands/node.py index 057c4d5..ca88043 100644 --- a/clusterman/commands/node.py +++ b/clusterman/commands/node.py @@ -60,9 +60,9 @@ def check(timeout): else: print("Error: Some of your nodes are not reachable") -def exec(command, group=None): +def exec(command, group=None, use_key=False): nodes=utils.get_node_list() if group is None else utils.get_node_in_group(group) for ip in nodes: print("----- Node {} -----".format(ip)) - print(utils.ssh_exec(ip," ".join(command))) + print(utils.ssh_exec(ip," ".join(command),use_key)) |
