From 39484a62a7ed5faed041bf5469a0d5bd191bc3b1 Mon Sep 17 00:00:00 2001 From: xq2005 Date: Fri, 2 Jul 2010 08:24:08 +0000 Subject: [PATCH] modify by xu qing on xCAT_plugin::web::web_update for update the rpm on web interface git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6637 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/web.pm | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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}); } }