From f90f682316f2f28bea5969a2e5912ea128cfffa7 Mon Sep 17 00:00:00 2001 From: sakolish Date: Wed, 13 Feb 2008 20:22:02 +0000 Subject: [PATCH] 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 --- perl-xCAT-2.0/xCAT/PPCcli.pm | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/perl-xCAT-2.0/xCAT/PPCcli.pm b/perl-xCAT-2.0/xCAT/PPCcli.pm index 1bcb1da8d..44c66c1ca 100644 --- a/perl-xCAT-2.0/xCAT/PPCcli.pm +++ b/perl-xCAT-2.0/xCAT/PPCcli.pm @@ -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" ); }