Add switch -d to take diagnostic snapshot if deployment fail
If we run script with -d switch and deployment status will timeout after 1500 seconds script will create diagnostic snapshot from env. Change-Id: I84f480dc3f2ff33e1fc600c9a146cd8063b5a5a0
This commit is contained in:
parent
dcf1cd736d
commit
9d239302ba
|
@ -31,8 +31,8 @@ Options:
|
||||||
(rely on existing local registry, default: false)
|
(rely on existing local registry, default: false)
|
||||||
-v, --openstack-version=VERSION
|
-v, --openstack-version=VERSION
|
||||||
set openstack version newton or master (default: master)
|
set openstack version newton or master (default: master)
|
||||||
-d, --debug-std
|
-d, --debug
|
||||||
print debug logs to standard output
|
create diagnostic snapshot if deployment fails
|
||||||
EOF
|
EOF
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
@ -43,13 +43,10 @@ function ccp_wait_for_deployment_to_finish {
|
||||||
echo "Waiting for OpenStack deployment to finish..."
|
echo "Waiting for OpenStack deployment to finish..."
|
||||||
sleep 5
|
sleep 5
|
||||||
cnt=$((cnt + 1))
|
cnt=$((cnt + 1))
|
||||||
if [ ${cnt} -eq 180 ]; then
|
if [ ${cnt} -eq 300 ]; then
|
||||||
echo "Max time exceeded"
|
echo "Max time exceeded"
|
||||||
if [ -n "${PRINT_STD}" ]; then
|
if [ -n "${DEBUG}" ]; then
|
||||||
for f in `kubectl --namespace $1 get pod | grep -v -E '(Running|ContainerCreating|Pending)' | awk {'print $1'} | tail -n +2`; do
|
./tools/diagnostic-snapshot.sh -n "${1}"
|
||||||
echo "-------------- ${f} ---------------"
|
|
||||||
kubectl --namespace "${1}" logs "${f}"
|
|
||||||
done
|
|
||||||
fi
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -76,7 +73,7 @@ function run_openstack_tests {
|
||||||
|
|
||||||
|
|
||||||
# Parse command line arguments:
|
# Parse command line arguments:
|
||||||
OPTS=`getopt -o 'hdsn:v:' --long help,debug-std,skip-building-images,number-of-envs:,openstack-version: -n 'parse-options' -- ${@}`
|
OPTS=`getopt -o 'hdsn:v:' --long help,debug,skip-building-images,number-of-envs:,openstack-version: -n 'parse-options' -- ${@}`
|
||||||
if [ ${?} != 0 ] ; then
|
if [ ${?} != 0 ] ; then
|
||||||
echo "Failed parsing options."
|
echo "Failed parsing options."
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -89,7 +86,7 @@ while true; do
|
||||||
-n|--number-of-envs ) NUMBER_OF_ENVS=${2}; shift; shift ;;
|
-n|--number-of-envs ) NUMBER_OF_ENVS=${2}; shift; shift ;;
|
||||||
-s|--skip-building-images ) BUILD_IMAGES=false; shift ;;
|
-s|--skip-building-images ) BUILD_IMAGES=false; shift ;;
|
||||||
-v|--openstack-version ) VERSION="${2}"; NAMESPACE_PREFIX="ccp-${2}"; shift; shift ;;
|
-v|--openstack-version ) VERSION="${2}"; NAMESPACE_PREFIX="ccp-${2}"; shift; shift ;;
|
||||||
-d|--debug-std ) PRINT_STD="yes"; shift ;;
|
-d|--debug ) DEBUG="yes"; shift ;;
|
||||||
-- ) shift; break ;;
|
-- ) shift; break ;;
|
||||||
* ) break ;;
|
* ) break ;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in New Issue