Redirect STDOUT only in verbose mode - Line #133
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@474 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
031c7d8617
commit
f90f682316
@ -117,7 +117,6 @@ sub connect {
|
||||
##################################################
|
||||
if ( $verbose ) {
|
||||
close STDERR;
|
||||
|
||||
if ( !open( STDERR, '>', \$expect_log )) {
|
||||
return( "Unable to redirect STDERR: $!" );
|
||||
}
|
||||
@ -131,12 +130,12 @@ sub connect {
|
||||
##################################################
|
||||
# Redirect STDOUT to variable
|
||||
##################################################
|
||||
close STDOUT;
|
||||
|
||||
if ( !open( STDOUT, '>', \$expect_log )) {
|
||||
return( "Unable to redirect STDOUT: $!" );
|
||||
}
|
||||
|
||||
if ( $verbose ) {
|
||||
close STDOUT;
|
||||
if ( !open( STDOUT, '>', \$expect_log )) {
|
||||
return( "Unable to redirect STDOUT: $!" );
|
||||
}
|
||||
}
|
||||
unless ( $ssh->spawn( "ssh", $parameters )) {
|
||||
return( $expect_log."Unable to spawn ssh connection to server" );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user