From 5a2d8e547e8e106bd277fe7b4da9fa8fb0d63e55 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 19 Jun 2014 13:50:58 -0400 Subject: [PATCH] address bashate style violations these were mostly inconsistent indentation, there were a couple of blocks that came over with 2 space indents, even though the prevailing indent is 4. One issue found with function foo() {, again the prevailing style is function foo {, so enforcing that rule seems appropriate. Change-Id: I5761064a758eddccd27979e2a71925e004e9ccc8 --- devstack-vm-gate-wrap.sh | 38 +++++++++++----------- devstack-vm-gate.sh | 2 +- functions.sh | 68 ++++++++++++++++++++-------------------- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/devstack-vm-gate-wrap.sh b/devstack-vm-gate-wrap.sh index ddb32821..d764cecf 100755 --- a/devstack-vm-gate-wrap.sh +++ b/devstack-vm-gate-wrap.sh @@ -280,11 +280,11 @@ export DEVSTACK_GATE_TIMEOUT=${DEVSTACK_GATE_TIMEOUT:-60} export OVERRIDE_ZUUL_BRANCH=${OVERRIDE_ZUUL_BRANCH:-$ZUUL_BRANCH} if ! function_exists "gate_hook"; then - # the command we use to run the gate - function gate_hook { - remaining_time - timeout -s 9 ${REMAINING_TIME}m $BASE/new/devstack-gate/devstack-vm-gate.sh - } + # the command we use to run the gate + function gate_hook { + remaining_time + timeout -s 9 ${REMAINING_TIME}m $BASE/new/devstack-gate/devstack-vm-gate.sh + } fi echo "Triggered by: https://review.openstack.org/$ZUUL_CHANGE patchset $ZUUL_PATCHSET" @@ -320,12 +320,12 @@ fi # Run pre test hook if we have one if function_exists "pre_test_hook"; then - echo "Running pre_test_hook" - xtrace=$(set +o | grep xtrace) - set -o xtrace - tsfilter pre_test_hook | tee $WORKSPACE/devstack-gate-pre-test-hook.txt - sudo mv $WORKSPACE/devstack-gate-pre-test-hook.txt $BASE/logs/ - $xtrace + echo "Running pre_test_hook" + xtrace=$(set +o | grep xtrace) + set -o xtrace + tsfilter pre_test_hook | tee $WORKSPACE/devstack-gate-pre-test-hook.txt + sudo mv $WORKSPACE/devstack-gate-pre-test-hook.txt $BASE/logs/ + $xtrace fi # Run the gate function @@ -341,14 +341,14 @@ fi # Run post test hook if we have one if [ $GATE_RETVAL -eq 0 ] && function_exists "post_test_hook"; then - echo "Running post_test_hook" - xtrace=$(set +o | grep xtrace) - set -o xtrace -o pipefail - tsfilter post_test_hook | tee $WORKSPACE/devstack-gate-post-test-hook.txt - RETVAL=$? - sudo mv $WORKSPACE/devstack-gate-post-test-hook.txt $BASE/logs/ - set +o pipefail - $xtrace + echo "Running post_test_hook" + xtrace=$(set +o | grep xtrace) + set -o xtrace -o pipefail + tsfilter post_test_hook | tee $WORKSPACE/devstack-gate-post-test-hook.txt + RETVAL=$? + sudo mv $WORKSPACE/devstack-gate-post-test-hook.txt $BASE/logs/ + set +o pipefail + $xtrace fi if [ $GATE_RETVAL -eq 137 ] && [ -f $WORKSPACE/gate.pid ] ; then diff --git a/devstack-vm-gate.sh b/devstack-vm-gate.sh index c81cf485..d56143e1 100755 --- a/devstack-vm-gate.sh +++ b/devstack-vm-gate.sh @@ -23,7 +23,7 @@ set -o errexit echo $PPID > $WORKSPACE/gate.pid -function setup_localrc() { +function setup_localrc { LOCALRC_OLDNEW=$1; LOCALRC_BRANCH=$2; diff --git a/functions.sh b/functions.sh index 2fe74ed8..d6b7fb56 100644 --- a/functions.sh +++ b/functions.sh @@ -533,36 +533,36 @@ function cleanup_host { # copy devstack log files if [ -d $BASE/old ]; then - sudo mkdir -p $BASE/logs/old $BASE/logs/new + sudo mkdir -p $BASE/logs/old $BASE/logs/new - # copy all log files, but note that devstack creates a shortened - # symlink without timestamp (foo.log -> foo.2014-01-01-000000.log) - # for each log to latest log. Thus we just copy the symlinks to - # avoid excessively long file-names. - find $BASE/old/screen-logs -type l -print0 | \ - xargs -0 -I {} sudo cp {} $BASE/logs/old - sudo cp $BASE/old/devstacklog.txt $BASE/logs/old/ - sudo cp $BASE/old/devstack/localrc $BASE/logs/old/localrc.txt - sudo cp $BASE/old/tempest/etc/tempest.conf $BASE/logs/old/tempest_conf.txt + # copy all log files, but note that devstack creates a shortened + # symlink without timestamp (foo.log -> foo.2014-01-01-000000.log) + # for each log to latest log. Thus we just copy the symlinks to + # avoid excessively long file-names. + find $BASE/old/screen-logs -type l -print0 | \ + xargs -0 -I {} sudo cp {} $BASE/logs/old + sudo cp $BASE/old/devstacklog.txt $BASE/logs/old/ + sudo cp $BASE/old/devstack/localrc $BASE/logs/old/localrc.txt + sudo cp $BASE/old/tempest/etc/tempest.conf $BASE/logs/old/tempest_conf.txt - # grenade logs - sudo cp $BASE/new/grenade/localrc $BASE/logs/grenade_localrc.txt - # grenade logs directly and uses similar timestampped files to - # devstack. So temporarily copy out & rename the latest log - # files from the short-symlinks into grenade/, clean-up left - # over time-stampped files and put the interesting logs back at - # top-level for easy access - sudo mkdir -p $BASE/logs/grenade - sudo cp $BASE/logs/grenade.sh.log $BASE/logs/grenade/ - sudo cp $BASE/logs/grenade.sh.log.summary \ - $BASE/logs/grenade/grenade.sh.summary.log - sudo rm $BASE/logs/grenade.sh.* - sudo mv $BASE/logs/grenade/*.log $BASE/logs - sudo rm -rf $BASE/logs/grenade + # grenade logs + sudo cp $BASE/new/grenade/localrc $BASE/logs/grenade_localrc.txt + # grenade logs directly and uses similar timestampped files to + # devstack. So temporarily copy out & rename the latest log + # files from the short-symlinks into grenade/, clean-up left + # over time-stampped files and put the interesting logs back at + # top-level for easy access + sudo mkdir -p $BASE/logs/grenade + sudo cp $BASE/logs/grenade.sh.log $BASE/logs/grenade/ + sudo cp $BASE/logs/grenade.sh.log.summary \ + $BASE/logs/grenade/grenade.sh.summary.log + sudo rm $BASE/logs/grenade.sh.* + sudo mv $BASE/logs/grenade/*.log $BASE/logs + sudo rm -rf $BASE/logs/grenade - NEWLOGTARGET=$BASE/logs/new + NEWLOGTARGET=$BASE/logs/new else - NEWLOGTARGET=$BASE/logs + NEWLOGTARGET=$BASE/logs fi find $BASE/new/screen-logs -type l -print0 | \ xargs -0 -I {} sudo cp {} $NEWLOGTARGET/ @@ -577,8 +577,8 @@ function cleanup_host { # Copy Ironic nodes console logs if they exist if [ -d $BASE/new/ironic-bm-logs ] ; then - sudo mkdir -p $BASE/logs/ironic-bm-logs - sudo cp $BASE/new/ironic-bm-logs/*.log $BASE/logs/ironic-bm-logs/ + sudo mkdir -p $BASE/logs/ironic-bm-logs + sudo cp $BASE/new/ironic-bm-logs/*.log $BASE/logs/ironic-bm-logs/ fi # Copy tempest config file @@ -591,14 +591,14 @@ function cleanup_host { $WORKSPACE/pip-freeze.txt $BASE/logs/ if [ `command -v dpkg` ]; then - dpkg -l> $WORKSPACE/dpkg-l.txt - gzip -9 dpkg-l.txt - sudo mv $WORKSPACE/dpkg-l.txt.gz $BASE/logs/ + dpkg -l> $WORKSPACE/dpkg-l.txt + gzip -9 dpkg-l.txt + sudo mv $WORKSPACE/dpkg-l.txt.gz $BASE/logs/ fi if [ `command -v rpm` ]; then - rpm -qa > $WORKSPACE/rpm-qa.txt - gzip -9 rpm-qa.txt - sudo mv $WORKSPACE/rpm-qa.txt.gz $BASE/logs/ + rpm -qa > $WORKSPACE/rpm-qa.txt + gzip -9 rpm-qa.txt + sudo mv $WORKSPACE/rpm-qa.txt.gz $BASE/logs/ fi # Process testr artifacts.