From 0f7ba1b70df90d23ddade6c5efa88eed38951883 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Fri, 10 Jul 2026 04:14:46 +0200 Subject: [PATCH] Add connect timeout option to nodeshell --- confluent_client/bin/nodeshell | 4 ++++ confluent_client/doc/man/nodeshell.ronn | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/confluent_client/bin/nodeshell b/confluent_client/bin/nodeshell index 90ab89d9..23a15703 100755 --- a/confluent_client/bin/nodeshell +++ b/confluent_client/bin/nodeshell @@ -53,6 +53,8 @@ def run(): help='Specify a custom port for ssh') argparser.add_option('-s', '--substitutename', help='Use a different name other than the nodename for ssh') + argparser.add_option('-t', '--timeout', type='int', default=0, + help='Timeout in seconds for each node ssh connection') argparser.add_option('-x', '--noexpression', action='store_true', help='Suppress expression expansion of command') argparser.add_option('-m', '--maxnodes', type='int', @@ -119,6 +121,8 @@ def run(): cmdv += ['-p', '{0}'.format(options.port)] if options.loginname: cmdv += ['-l', options.loginname] + if options.timeout: + cmdv += ['-o', 'ConnectTimeout={0}'.format(options.timeout)] cmdv += [sshnode, cmd] if currprocs < concurrentprocs: currprocs += 1 diff --git a/confluent_client/doc/man/nodeshell.ronn b/confluent_client/doc/man/nodeshell.ronn index 1882cc8a..b29e6d97 100644 --- a/confluent_client/doc/man/nodeshell.ronn +++ b/confluent_client/doc/man/nodeshell.ronn @@ -34,9 +34,12 @@ as stderr, unlike psh which combines all stdout and stderr into stdout. Specify a substitution name instead of the nodename. If no {} are in the substitution, it is considered to be an append. For example, '-s -ib' would produce 'node1-ib' from 'node1'. Full expression syntax is supported, in which case the substitution is considered to be the entire - new name. {node}-ib would be equivalent to -ib. For example, nodeshell -s {bmc} node1 + new name. {node}-ib would be equivalent to -ib. For example, nodeshell -s {bmc} node1 would ssh to the BMC instead of the node. +* `-t TIMEOUT`, `--timeout=TIMEOUT` + Timeout in seconds for each node ssh connection attempt + ## EXAMPLES * Running `echo hi` on for nodes: