Skip to content

Commit

Permalink
lib_tcl: improve handling of extra ssh args from test
Browse files Browse the repository at this point in the history
Unit testing in this area is unfortunately weak. Hopefully this causes
no regressions for users that may have worked around the previous
somewhat broken implementation.

The idea with the magic tcl variable "args" is that it allows the user
to pass an arbitrary amount of arguments at the end of the function
call. in 9pm::ssh::connect we expect this to look something like:

9pm::ssh::connect $node "-o StrictHostKeyChecking=no" "-o ..."

Signed-off-by: Richard Alpe <[email protected]>
  • Loading branch information
rical committed Sep 29, 2023
1 parent 1f68222 commit 5b959be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib_tcl/ssh.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ namespace eval ::9pm::ssh {
if {$keyfile != ""} {
append ssh_cmd " -i $keyfile"
}
if {$args != ""} {
append ssh_cmd " $args"
foreach arg $args {
append ssh_cmd " $arg"
}

::9pm::output::debug "Connecting to \"$hostname\""
::9pm::output::debug "Running: \"$ssh_cmd\""

expect *
send "$ssh_cmd\n"
Expand Down

0 comments on commit 5b959be

Please sign in to comment.