summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhijiang Hu <hu.zhijiang@zte.com.cn>2017-11-12 22:19:29 -0500
committerZhijiang Hu <hu.zhijiang@zte.com.cn>2017-11-12 22:46:42 -0500
commit58510b282114adfe69d7f64fc2f9e247856e4260 (patch)
treee64c3253a6fe865247f49f3170709a9f6db885f2
parent338ba059e72c9113a21729f41e584eabd68d4fe8 (diff)
Dump log after deplying timeout
Change-Id: I8ff298bc09bd3117f5ae8a1d81be3e5661a56e9a Signed-off-by: Zhijiang Hu <hu.zhijiang@zte.com.cn>
-rwxr-xr-xdeploy/check_openstack_progress.sh54
1 files changed, 36 insertions, 18 deletions
diff --git a/deploy/check_openstack_progress.sh b/deploy/check_openstack_progress.sh
index 60c65b32..c4ba5978 100755
--- a/deploy/check_openstack_progress.sh
+++ b/deploy/check_openstack_progress.sh
@@ -1,4 +1,14 @@
#!/bin/bash
+##############################################################################
+# Copyright (c) 2017 ZTE Corporation and others.
+# hu.zhijiang@zte.com.cn
+# lu.yao135@zte.com.cn
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
usage()
{
cat << EOF
@@ -12,6 +22,29 @@ EXAMPLE:
EOF
}
+function dump_log_for_cluster()
+{
+ local cid
+ cid=$1
+
+ echo "Show daisy api log as following ..."
+ cat /var/log/daisy/api.log |grep -v wsgi
+
+ files=$(ls /var/log/daisy/kolla_$cid* 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_$cid*
+ else
+ prepare_files=$(ls /var/log/daisy/kolla_prepare_$cid* 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_$cid*
+ fi
+ fi
+}
+
while getopts "n:h" OPTION
do
case $OPTION in
@@ -39,7 +72,8 @@ count=0
while true; do
if [ $count -gt $maxcount ]; then
- echo "It took too long to install openstack, exit 1."
+ echo "It took too long to install openstack, exit."
+ dump_log $cluster_id
exit 1
fi
count=$[count + 1]
@@ -52,23 +86,7 @@ while true; do
break
elif [ $openstack_install_failed -gt 0 ]; then
echo "openstack installation failed ..."
- echo "Show daisy api log as following ..."
- cat /var/log/daisy/api.log |grep -v wsgi
-
- 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
-
+ dump_log $cluster_id
exit 1
else
# get 'Role_progress' column