diff --git a/scripts/zvm/launch_vm.sh b/scripts/zvm/launch_vm.sh index 9893bfb1..ef2ed8dd 100755 --- a/scripts/zvm/launch_vm.sh +++ b/scripts/zvm/launch_vm.sh @@ -91,9 +91,13 @@ if [ $rc -ne 0 ]; then fi # add disk: -# note: frontend sends disk size counting in G now. -rc=$(curl -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}' | jq .rc) -if [ $rc -ne 0 ]; then +# note: frontend sends disk size counting in G now. +#rc=$(curl -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}' | jq .rc) +result=$(curl -w %{http_code} -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}') +httpRc=${result: -3} +zvmResult=${result%???} +rc=$(echo $zvmResult | jq .rc) +if [ $httpRc -eq 500 -o $rc -ne 0 ]; then # remove user ? echo "$vm_ID: Add disk failed!" echo "|:-COMMAND-:| `basename $0` '$ID' '$vm_stat' '$SCI_CLIENT_ID' '$vm_ID: Add disk failed!'" diff --git a/scripts/zvm/oc_vm.sh b/scripts/zvm/oc_vm.sh index 1c9c83d3..9076a98a 100755 --- a/scripts/zvm/oc_vm.sh +++ b/scripts/zvm/oc_vm.sh @@ -59,8 +59,13 @@ if [ $rc -ne 0 ]; then fi # add disk: -rc=$(curl -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}' | jq .rc) -if [ $rc -ne 0 ]; then +# note: frontend sends disk size counting in G now +#rc=$(curl -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}' | jq .rc) +result=$(curl -w %{http_code} -s $zvm_service/guests/$vm_ID/disks -X POST -d '{"disk_info":{"disk_list":[{"size":"'"$disk_size"'G", "is_boot_disk":"True"}]}}') +httpRc=${result: -3} +zvmResult=${result%???} +rc=$(echo $zvmResult | jq .rc) +if [ $httpRc -eq 500 -o $rc -ne 0 ]; then # remove user ? echo "$vm_ID: Add disk failed!" echo "|:-COMMAND-:| launch_vm.sh '$ID' '$vm_stat' '$SCI_CLIENT_ID' '$vm_ID: Add disk failed!'" diff --git a/web/clui/public/misc/openshift/ocd.sh b/web/clui/public/misc/openshift/ocd.sh index 688d0cec..ec32cc3a 100644 --- a/web/clui/public/misc/openshift/ocd.sh +++ b/web/clui/public/misc/openshift/ocd.sh @@ -287,7 +287,7 @@ sshKey: '$ssh_key' $parts EOF sed -i "/^$/d" install-config.yaml - if [ "$virt_type" = 'kvm-s390x' ] || ["$virt_type" = 'zvm' ]; then + if [ "$virt_type" = 'kvm-s390x' ] || [ "$virt_type" = 'zvm' ]; then sed -i "s/architecture.*$/architecture: s390x/" install-config.yaml fi echo "start to backup"