ctdb-tools: Introduce a variable to hold the ssh command
authorMartin Schwenke <martin@meltin.net>
Wed, 28 Feb 2018 04:02:03 +0000 (15:02 +1100)
committerMartin Schwenke <martins@samba.org>
Thu, 1 Mar 2018 18:39:15 +0000 (19:39 +0100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tools/onnode

index 0175513d1cb31ab12d5ec34f088a821547e3696a..890b60f0afc3c221426d254f44e5b12a80674d5b 100755 (executable)
@@ -368,11 +368,12 @@ for n in $nodes ; do
     # the filters to operate independently, the output of
     # stdout_filter is sent to a temporary file descriptor (3), which
     # is redirected back to stdout at the outermost level.
+    ssh_cmd="$ONNODE_SSH $ssh_opts $ONNODE_SSH_OPTS"
     if $parallel ; then
        {
            exec 3>&1
            {
-               $ONNODE_SSH $ssh_opts $ONNODE_SSH_OPTS "$n" "$command" |
+               $ssh_cmd "$n" "$command" |
                    stdout_filter >&3
            } 2>&1 | stderr_filter
        } &
@@ -385,7 +386,7 @@ for n in $nodes ; do
        {
            exec 3>&1
            {
-               $ONNODE_SSH $ssh_opts $ONNODE_SSH_OPTS "$n" "$command" |
+               $ssh_cmd "$n" "$command" |
                    stdout_filter >&3
            } 2>&1 | stderr_filter
        } || retcode=$?