From: Nick J. <nje...@us...> - 2003-04-23 22:54:07
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory sc8-pr-cvs1:/tmp/cvs-serv21744/lib/SandWeb Modified Files: Shell.pm Log Message: many formatting fixes (tabs) Also, fixed Barts problem, seems system_timeout wasn't being set properly, and ontop of that, the default (if value is null) was set to a string '', so this caused problems. Fixed assignment, and set default to 300 just in case this happens again. Index: Shell.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Shell.pm,v retrieving revision 1.32 retrieving revision 1.33 diff -U2 -r1.32 -r1.33 --- Shell.pm 1 Apr 2003 02:46:27 -0000 1.32 +++ Shell.pm 23 Apr 2003 22:53:43 -0000 1.33 @@ -162,5 +162,5 @@ # system_password is the user's password on the local box ( optional ) - my $system_timeout = $args{'system_timeout'} || ''; + my $system_timeout = $args{'system_timeout'} || 300; # users_dir is the user's SandWeb home directory ( required ) @@ -288,11 +288,10 @@ my %return = ( - output => "$output", - error => "$error_message", - ); - - return %return; - } + output => "$output", + error => "$error_message", + ); + return %return; + } $error = $?/256; @@ -313,8 +312,7 @@ if ( "$@" ) { - my $output = ""; my $error_message = "Timeout reached of $system_timeout seconds reached, operation aborted.\n"; - + my %return = ( output => "$output", @@ -324,11 +322,11 @@ return %return; } - + $error = $?/256; - $raw_output =~ s/^M/\n/g; - my @lined_output = split(/\n/, $raw_output); - shift @lined_output; - shift @lined_output; - $output = join('', @lined_output); + $raw_output =~ s/^M/\n/g; + my @lined_output = split(/\n/, $raw_output); + shift @lined_output; + shift @lined_output; + $output = join('', @lined_output); } } elsif ( $vcs ) { @@ -376,11 +374,12 @@ } + $raw_output =~ s/^M/\n/g; + my @lined_output = split(/\n/, $raw_output); + shift @lined_output; - $raw_output =~ s/^M/\n/g; - my @lined_output = split(/\n/, $raw_output); - shift @lined_output; - if ( "@lined_output" =~ "'s password:" ) { + if ( "@lined_output" =~ "'s password:" ) { shift @lined_output; } + if ( "@lined_output" =~ "^RSA key fingerprint is" ) { shift @lined_output; @@ -392,5 +391,5 @@ shift @lined_output; } - $output = join('', @lined_output); + $output = join('', @lined_output); } else { if ($log) { @@ -479,5 +478,5 @@ my %args = @_; - my $system_timeout = $self{'system_timeout'}; + my $system_timeout = $self->{'system_timeout'}; my $log = $self->{'log'} || ''; |