From 001c9c022284a3b384c77a72ee4e6bd2bcf5658a Mon Sep 17 00:00:00 2001 From: root Date: Thu, 22 Oct 2015 18:16:02 +0000 Subject: Improve Output, added verbose flag --- leap-platform-test | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/leap-platform-test b/leap-platform-test index 8024ac7..da086ed 100755 --- a/leap-platform-test +++ b/leap-platform-test @@ -22,6 +22,7 @@ OPTIONS -c|--config file specify config file -h|--help show help -l|--lock refuse to deploy if lockfile from previous failures exists + -v|--verbose show also successful puppet resource changes, not only errors -V|--versions show versions/git revision of leap_cli and leap_platoform in provider dir COMMANDS @@ -148,7 +149,7 @@ deploy() { returncode=0 # 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 -| - hiera| = created hiera/| = updated hiera/| = updated secrets.json| - cd /root/| - rolling backexecuting| - files/|\[bin,tests,puppet\] ->|] Hostname updated.| = Updating submodule puppet/modules|Warning: Permanently added.*to the list of known hosts.| = leap command v| = leap platform v| - \[.*\] ok| - \[.*\] STARTING APPLY| - \[.*\] APPLY COMPLETE|net.ssh.authentication.agent.*could not connect to ssh-agent' + FILTER_CLI='= read|= loading|= no change| - executing| = executing| = applying| = ran git| = checking| = synching| = skipping file_path| - cd .*; rsync -| - hiera| = created hiera/| = updated hiera/| = updated secrets.json| - cd /root/| - rolling backexecuting| - files/|\[bin,tests,puppet\] ->|] Hostname updated.| = Updating submodule puppet/modules|Warning: Permanently added.*to the list of known hosts.| = leap command v| = leap platform v| - \[.*\] ok| - \[.*\] STARTING APPLY| - \[.*\] APPLY COMPLETE|net.ssh.authentication.agent.*could not connect to ssh-agent|Deploying ' FILTER_PUPPET="] notice: |] No change to hostname|] Puppet apply complete \(changes made\).|] warning: Dynamic lookup|] warning: Scope\(Class|Skipping because of failed dependencies|warning: You cannot collect without storeconfigs being set|warning: Not collecting exported resources without storeconfigs|warning: default \`to_a' will be obsolete" @@ -170,7 +171,13 @@ deploy() { ERRLOG2="$LOGDIR/deploy-error.log" echo "Deploying \"$vm\" on $( date )"|tee -a "$LOG1" "$LOG2" - $LEAP_CMD $OPTS -v 2 deploy "$vm" 2>&1 | ts | tee -a "$LOG1" "$LOG2" | egrep -v "$FILTER_ALL" | tee -a "$ERRLOG1" "$ERRLOG2" > /dev/null + if $verbose + then + $LEAP_CMD $OPTS -v 2 deploy "$vm" 2>&1 | tee -a "$LOG1" "$LOG2" + egrep -v "$FILTER_ALL" $LOG2 | tee -a "$ERRLOG1" "$ERRLOG2" + else + $LEAP_CMD $OPTS -v 2 deploy "$vm" 2>&1 | tee -a "$LOG1" "$LOG2" | egrep -v "$FILTER_ALL" | tee -a "$ERRLOG1" "$ERRLOG2" > /dev/null + fi # send an host-specific error mail on deploy failures if [ -s "$ERRLOG1" ] @@ -495,6 +502,7 @@ export VAGRANT_DEFAULT_PROVIDER="libvirt" config="" all=false +verbose=false print_versions=false # default in lib/leap_cli/leapfile.rb IP_PREFIX='10.5.5' @@ -515,7 +523,8 @@ do -c|--config) config=$2; shift ;; -h|--help) usage; exit 1;; -l|--lock) lock=true;; - -V|--versions) print_versions=true;; + -v|--verbose) verbose=true;; + -V|--versions) print_versions=true;; (--) shift; break;; (-*) echo "$0: error - unrecognized option $1" 1>&2; exit 1;; (*) break;; -- cgit v1.2.3