diff --git a/perl-xCAT-2.0/xCAT/PPC.pm b/perl-xCAT-2.0/xCAT/PPC.pm index 38a16d1d2..c7c7886a9 100644 --- a/perl-xCAT-2.0/xCAT/PPC.pm +++ b/perl-xCAT-2.0/xCAT/PPC.pm @@ -510,8 +510,24 @@ sub invoke_cmd { # Direct-attached FSP handler ######################################## if ( $hwtype eq "fsp" ) { - my $result = xCAT::PPCfsp::handler( $host, $request ); + my @exp = xCAT::PPCfsp::connect( $request, $host ); + #################################### + # Error connecting + #################################### + if ( ref($exp[0]) ne "LWP::UserAgent" ) { + send_msg( $request, $exp[0] ); + return; + } + my $result = xCAT::PPCfsp::handler( $host, $request, \@exp ); + + #################################### + # Output verbose Perl::LWP + #################################### + if ( $verbose ) { + my $lwp_log = $exp[3]; + send_msg( $request, $$lwp_log ); + } my $out = $request->{pipe}; print $out freeze( $result ); print $out "\nENDOFFREEZE6sK4ci\n"; @@ -542,6 +558,11 @@ sub invoke_cmd { ######################################## my $result = runcmd( $request, $nodes, \@exp ); + ######################################## + # Close connection to remote server + ######################################## + xCAT::PPCcli::disconnect( \@exp ); + ######################################## # Output verbose Expect ######################################## @@ -549,11 +570,6 @@ sub invoke_cmd { my $expect_log = $exp[6]; send_msg( $request, $$expect_log ); } - ######################################## - # Close connection to remote server - ######################################## - xCAT::PPCcli::disconnect( \@exp ); - ######################################## # Return error ########################################