From 4b67937556c3c4a6bbe1b530ea77bbcb068af75c Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Fri, 25 May 2012 09:55:33 -0700 Subject: [PATCH] CS-15089: cloud-sysvmadm - fixed broken parsing in queryAsyncJobResult part of the code reviewed-by: Frank Zhang --- setup/bindir/cloud-sysvmadm.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup/bindir/cloud-sysvmadm.in b/setup/bindir/cloud-sysvmadm.in index 4659c9f4af8..3bb9c2fa3fa 100755 --- a/setup/bindir/cloud-sysvmadm.in +++ b/setup/bindir/cloud-sysvmadm.in @@ -212,7 +212,8 @@ reboot_router(){ } restart_networks(){ - networks=(`mysql -h $db --user=$user --password=$password --skip-column-names -U cloud -e "select n.id from networks n, network_offerings no where n.network_offering_id = no.id and no.system_only = 0 and n.removed is null"`) + networks=(`mysql -h $db --user=$user --password=$password --skip-column-names -U cloud -e "select n.id + from networks n, network_offerings no where n.network_offering_id = no.id and no.system_only = 0 and n.removed is null"`) length_networks=(${#networks[@]}) echo -e "\nRestarting networks... " @@ -295,7 +296,7 @@ restart_network(){ query_async_job_result() { while [ 1 ] do - jobstatus=`curl -sS "http://$ms:8096/?command=queryAsyncJobResult&jobId=$1&response=json" | sed 's/\"//g' | sed 's/ //g' | sed 's/{//g' | sed 's/}//g' | awk -F, {'print $2'} | awk -F: {'print $2'}` + jobstatus=`curl -sS "http://$ms:8096/?command=queryAsyncJobResult&jobId=$1&response=json" | sed 's/\"//g' | sed 's/ //g' | sed 's/{//g' | sed 's/}//g' | awk -F, {'print $4'} | awk -F: {'print $2'}` if [ "$jobstatus" != "0" ]; then echo $jobstatus break