Export kolla preparation log when install failed 51/41451/1
authorAlex Yang <yangyang1@zte.com.cn>
Sat, 9 Sep 2017 02:51:23 +0000 (10:51 +0800)
committerAlex Yang <yangyang1@zte.com.cn>
Sat, 9 Sep 2017 02:51:23 +0000 (10:51 +0800)
Change-Id: I08844b899de2dba539b3c3942345f83d1ac3c198
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
deploy/check_openstack_progress.sh

index a50df23..60c65b3 100755 (executable)
@@ -48,15 +48,27 @@ while true; do
     openstack_install_active=`daisy host-list --cluster-id $cluster_id | awk -F "|" '{print $13}' | grep -c "active" `
     openstack_install_failed=`daisy host-list --cluster-id $cluster_id | awk -F "|" '{print $13}' | grep -c "install-failed" `
     if [ $openstack_install_active -eq $hosts_num ]; then
-        echo "openstack installing successful ..."
+        echo "openstack installation succeded ..."
         break
     elif [ $openstack_install_failed -gt 0 ]; then
-        echo "openstack installing have failed..."
-        echo "this is the daisy api log"
+        echo "openstack installation failed ..."
+        echo "Show daisy api log as following ..."
         cat /var/log/daisy/api.log |grep -v wsgi
-        echo "----------------------------------------------------"
-        echo "this is the kolla install log"
-        tail -n 5000 /var/log/daisy/kolla_$cluster_id*
+
+        files=$(ls /var/log/daisy/kolla_$cluster_id* 2>/dev/null | wc -l)
+        if [ $files -ne 0 ]; then
+            echo "----------------------------------------------------"
+            echo "Show kolla installation log as following ..."
+            tail -n 5000 /var/log/daisy/kolla_$cluster_id*
+        else
+            prepare_files=$(ls /var/log/daisy/kolla_prepare_$cluster_id* 2>/dev/null | wc -l)
+            if [ $prepare_files -ne 0 ]; then
+                echo "----------------------------------------------------"
+                echo "Show kolla preparation log as following ..."
+                tail -n 5000 /var/log/daisy/kolla_prepare_$cluster_id*
+            fi
+        fi
+
         exit 1
     else
         # get 'Role_progress' column