From 0b5504a1c944cd0f21cc65464336f81f9076d787 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 2 Oct 2017 21:25:01 +0100 Subject: xci: xci-deploy: Add simple error handler Add a simple function to collect useful information when submitting bug reports. Change-Id: If24b76d2742edffa2269d39dcc998675d1388214 Signed-off-by: Markos Chandras --- xci/xci-deploy.sh | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'xci') diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh index fd3849be..da111c23 100755 --- a/xci/xci-deploy.sh +++ b/xci/xci-deploy.sh @@ -3,6 +3,29 @@ set -o errexit set -o nounset set -o pipefail +submit_bug_report() { + echo "" + echo "-------------------------------------------------------------------------" + echo "Oh nooooo! The XCI deployment failed miserably :-(" + echo "" + echo "If you need help, please choose one of the following options" + echo "* #opnfv-pharos @ freenode network" + echo "* opnfv-tech-discuss mailing list (https://lists.opnfv.org/mailman/listinfo/opnfv-tech-discuss)" + echo " - Please prefix the subject with [XCI]" + echo "* https://jira.opnfv.org (Release Engineering project)" + echo "" + echo "Do not forget to submit the following information on your bug report:" + echo "" + git diff --quiet && echo "releng-xci tree status: clean" || echo "releng-xci tree status: local modifications" + echo "opnfv/releng-xci version: $(git rev-parse HEAD)" + echo "openstack/bifrost version: $OPENSTACK_BIFROST_VERSION" + echo "openstack/openstack-ansible version: $OPENSTACK_OSA_VERSION" + echo "xci flavor: $XCI_FLAVOR" + echo "Environment variables:" + env | grep --color=never '^\(OPNFV\|XCI\|OPENSTACK\)_' + echo "-------------------------------------------------------------------------" +} + #------------------------------------------------------------------------------- # This script should not be run as root #------------------------------------------------------------------------------- @@ -50,6 +73,9 @@ for local_user_var in ${user_local_dev_vars[@]}; do done unset user_local_dev_vars local_user_var +# register our handler +trap submit_bug_report ERR + #------------------------------------------------------------------------------- # Log info to console #------------------------------------------------------------------------------- @@ -57,7 +83,7 @@ echo "Info: Starting XCI Deployment" echo "Info: Deployment parameters" echo "-------------------------------------------------------------------------" echo "xci flavor: $XCI_FLAVOR" -echo "opnfv/releng-xci version: $OPNFV_RELENG_VERSION" +echo "opnfv/releng-xci version: $(git rev-parse HEAD)" echo "openstack/bifrost version: $OPENSTACK_BIFROST_VERSION" echo "openstack/openstack-ansible version: $OPENSTACK_OSA_VERSION" echo "-------------------------------------------------------------------------" @@ -307,3 +333,5 @@ PASSWORD=$(ssh -q root@192.168.122.2 awk "/OS_PASSWORD=./" openrc) echo "Info: Admin username - ${USERNAME##*=}" echo "Info: Admin password - ${PASSWORD##*=}" echo "Info: It is recommended to change the default password." + +# vim: set ts=4 sw=4 expandtab: -- cgit 1.2.3-korg