diff --git a/xCAT-server/lib/xcat/plugins/web.pm b/xCAT-server/lib/xcat/plugins/web.pm index b4a339d0d..6d6e1d55c 100644 --- a/xCAT-server/lib/xcat/plugins/web.pm +++ b/xCAT-server/lib/xcat/plugins/web.pm @@ -360,7 +360,7 @@ sub web_update { $cmd = "wget -O " . $LocalRpmFilePath . " " . $RemoteRpmFilePath; if(0 != system($cmd)) { - $ReturnInfo = $ReturnInfo . "update " . $_ . " failed:" . $! . "\n"; + $ReturnInfo = $ReturnInfo . "update " . $_ . " failed: can not download the rpm\n"; $callback->({error=>$ReturnInfo, errorcode=>[1]}); return; } @@ -368,15 +368,9 @@ sub web_update { #update rpm by rpm packages. $cmd = "rpm -U " . $LocalRpmFilePath; - if (0 != system($cmd)) - { - $ReturnInfo = $ReturnInfo . "update " . $_ . " failed:" . $! . "\n"; - $callback->({error=>$ReturnInfo, errorcode=>[1]}); - return; - } - $ReturnInfo = $ReturnInfo . "update " . $_ . " successful.\n"; + $ReturnInfo = $ReturnInfo . readpipe($cmd); } - $callback->({info=>$cmd}); + $callback->({info=>$ReturnInfo}); } }