Fixed bug #36657: --load does not work with custom ssh.

This commit is contained in:
Ole Tange 2012-06-14 22:30:24 +02:00
parent 67d4db2279
commit 7a76e79185
3 changed files with 12 additions and 2 deletions

View file

@ -2096,6 +2096,8 @@ sub new {
} }
my $string = $sshlogin_string; my $string = $sshlogin_string;
my @unget = (); my @unget = ();
my $no_slash_string = $string;
$no_slash_string =~ s/[^-a-z0-9:]/_/gi;
return bless { return bless {
'string' => $string, 'string' => $string,
'jobs_running' => 0, 'jobs_running' => 0,
@ -2109,11 +2111,11 @@ sub new {
'control_path' => undef, 'control_path' => undef,
'time_to_login' => undef, 'time_to_login' => undef,
'loadavg_file' => $ENV{'HOME'} . "/.parallel/tmp/loadavg-" . 'loadavg_file' => $ENV{'HOME'} . "/.parallel/tmp/loadavg-" .
$$."-".$string, $$."-".$no_slash_string,
'loadavg' => undef, 'loadavg' => undef,
'last_loadavg_update' => 0, 'last_loadavg_update' => 0,
'swap_activity_file' => $ENV{'HOME'} . "/.parallel/tmp/swap_activity-" . 'swap_activity_file' => $ENV{'HOME'} . "/.parallel/tmp/swap_activity-" .
$$."-".$string, $$."-".$no_slash_string,
'swap_activity' => undef, 'swap_activity' => undef,
}, ref($class) || $class; }, ref($class) || $class;
} }

View file

@ -35,4 +35,10 @@ echo "### bug #36660: --workdir mkdir does not use --sshlogin custom ssh"
export -f ssh; export -f ssh;
parallel --workdir /tmp/foo/bar --transfer --sshlogin '/usr/bin/ssh localhost' cat ::: parallel_test.txt; parallel --workdir /tmp/foo/bar --transfer --sshlogin '/usr/bin/ssh localhost' cat ::: parallel_test.txt;
echo "bug #36657: --load does not work with custom ssh"
cd /tmp; echo OK > parallel_test.txt;
ssh () { echo Failed; };
export -f ssh;
parallel --load=1000% -S "/usr/bin/ssh localhost" echo ::: OK
EOF EOF

View file

@ -86,3 +86,5 @@ Chars per line (817788/7): 116826
OK OK
### bug #36660: --workdir mkdir does not use --sshlogin custom ssh ### bug #36660: --workdir mkdir does not use --sshlogin custom ssh
OK OK
bug #36657: --load does not work with custom ssh
OK