From 4ccf28754c8581d093d31ef582af5ce1d18c6234 Mon Sep 17 00:00:00 2001 From: Alex Yang Date: Sat, 9 Sep 2017 10:51:23 +0800 Subject: Export kolla preparation log when install failed Change-Id: I08844b899de2dba539b3c3942345f83d1ac3c198 Signed-off-by: Alex Yang --- deploy/check_openstack_progress.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'deploy/check_openstack_progress.sh') diff --git a/deploy/check_openstack_progress.sh b/deploy/check_openstack_progress.sh index a50df235..60c65b32 100755 --- a/deploy/check_openstack_progress.sh +++ b/deploy/check_openstack_progress.sh @@ -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 -- cgit 1.2.3-korg