diff options
author | Leap Admins <sysdev@leap.se> | 2013-06-26 16:13:49 +0000 |
---|---|---|
committer | Leap Admins <sysdev@leap.se> | 2013-06-26 16:13:49 +0000 |
commit | 8e459dae3d7aa781aa923d3e54ba5e41bc31aa94 (patch) | |
tree | fc16f63b61243e6fa3c0d0f5e3c1155b2bc02c38 /leap-platform-test | |
parent | c7d28b66a062bf99904e4f0c09d4c9f51c2b6ae2 (diff) |
added versions(), output of version in error mail
Diffstat (limited to 'leap-platform-test')
-rwxr-xr-x | leap-platform-test | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/leap-platform-test b/leap-platform-test index 1be49c0..e8f267d 100755 --- a/leap-platform-test +++ b/leap-platform-test @@ -96,7 +96,7 @@ deploy() { # we need to deploy with verbose level 2, and filter out unwanted stuff # until puppet errors show up in verbose level 0 +1 (#1750) - FILTER_CLI='= read|= loading|= no change| - executing| = executing| = applying| = ran git| = checking| = synching| = skipping file_path| - cd .*; rsync -a| - hiera| = created hiera/| - cd /root/| - rolling backexecuting| - files/ca/client_ca.crt|\[bin,puppet\] ->|] Hostname updated.| = Updating submodule puppet/modules|Warning: Permanently added.*to the list of known hosts.' + FILTER_CLI='= read|= loading|= no change| - executing| = executing| = applying| = ran git| = checking| = synching| = skipping file_path| - cd .*; rsync -a| - hiera| = created hiera/| - cd /root/| - rolling backexecuting| - files/ca/client_ca.crt|\[bin,puppet\] ->|] Hostname updated.| = Updating submodule puppet/modules|Warning: Permanently added.*to the list of known hosts.| = leap command v| = leap platform v' FILTER_PUPPET='] notice: |] No change to hostname|] Puppet apply complete|] warning: Dynamic lookup|] warning: Scope\(Class' FILTER_ALL="($FILTER_CLI|$FILTER_PUPPET)" @@ -115,7 +115,9 @@ deploy() { if [ -s $ERRLOG1 ] then - msg="From: $MAIL_FROM\nTo: $MAIL_TO\nSubject: Deploy to \"$vm\" had errors !\n\n`cat $ERRLOG1`" + versions=`versions` + msg="From: $MAIL_FROM\nTo: $MAIL_TO\nSubject: Deploy to \"$vm\" had errors !\n\n" + msg="$msg \n$versions \n\n`cat $ERRLOG1`" echo "Deploy to \"$vm\" on `date` had errors." | tee -a $LOG1 $LOG2 $ERRLOG2 echo cat $ERRLOG1 @@ -176,8 +178,21 @@ wait_for_node() { # beginning of version check versions () { cd $PLATFORMDIR - + platform_head=`git rev-parse HEAD` + cd $LEAP_CLI_DIR + cli_head=`git rev-parse HEAD` + if cli_head='edcb76a30bc0e13b9bf590cbd9f7f12d41a2cc13' + then + cli_head=`git rev-parse HEAD^` + fi + + cd $PROVIDERDIR + [ -d .git ] && provider_head=`git rev-parse HEAD` + + echo "provider ($PROVIDERDIR): $provider_head" + echo leap cli: $cli_head + leap -v 2 list | egrep '( = leap command v| = leap platform v)' } @@ -186,8 +201,9 @@ versions () { config="" all=false +print_versions=false -if ! options=$(getopt -o ac:h -l all,config:,help -- "$@") +if ! options=$(getopt -o avVc:h -l all,verbose,versions,config:,help -- "$@") then # something went wrong, getopt will put out an error message for us usage @@ -203,6 +219,7 @@ do -c|--config) config=$2; shift ;; -a|--all) all=true;; -v|--verbose) VERBOSE=1 ;; + -V|--versions) print_versions=true;; (--) shift; break;; (-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;; (*) break;; @@ -234,7 +251,12 @@ source /etc/leap/platform-test-common.cfg [ -e $PROVIDERDIR ] && cd $PROVIDERDIR - +if $print_versions +then + versions=`versions` + echo "$versions" + exit 0 +fi if $all ; then # use NODES variable from the config file |