Fix syntax issues in bash scripts and add bashate check

* [E] E003: Indent not multiple of 4

Change-Id: I7cd5c8b5348de065d84d03a316dc120f121841f3
This commit is contained in:
Christian Berendt 2015-11-09 21:48:07 +01:00
parent 5b92b0dc36
commit 0d906d8649
4 changed files with 20 additions and 20 deletions

View File

@ -1,3 +1,4 @@
bashate>=0.2 # Apache-2.0
hacking>=0.10.0,<0.11
httpretty
testtools

View File

@ -81,7 +81,7 @@ exit_on_failure "Unable to snapshot volume $VOL_NAME"
# Don't exit if this fails - as we may test platforms that don't
# provide this feature
if ! cinder backup-create --display-name $VOLBACK_NAME $VOL_ID; then
:
:
fi
@ -125,8 +125,7 @@ exit_on_failure "Unable to add interface on subnet $SUBNET_NAME to router $ROUT_
# Creating a floating IP and retrieving its IP Address
FIP_ADD=$(neutron floatingip-create $EXTNET_NAME \
| awk '/ floating_ip_address /{print $4}')
FIP_ADD=$(neutron floatingip-create $EXTNET_NAME | awk '/ floating_ip_address /{print $4}')
exit_if_empty "$FIP_ADD" "Unable to create or retrieve floating IP"
# Creating a security group
@ -170,11 +169,11 @@ exit_on_failure "Unable to create Glance iamge $IMG_NAME"
###############################
echo 'heat_template_version: 2013-05-23
description: >
Hello world HOT template' > dummy_stack.yaml
Hello world HOT template' > dummy_stack.yaml
# Don't exit if this fails - as we may test platforms that don't
# provide this feature
if ! heat stack-create -f dummy_stack.yaml $STACK_NAME; then
:
:
fi

View File

@ -1,19 +1,19 @@
#!/usr/bin/env bash
function exit_on_failure {
RET_CODE=$?
ERR_MSG=$1
if [ $RET_CODE -ne 0 ]; then
echo $ERR_MSG
exit 1
fi
RET_CODE=$?
ERR_MSG=$1
if [ $RET_CODE -ne 0 ]; then
echo $ERR_MSG
exit 1
fi
}
function exit_if_empty {
STRING=${1:-}
ERR_MSG=${2:-}
if [ -z "$STRING" ]; then
echo $ERR_MSG
exit 1
fi
STRING=${1:-}
ERR_MSG=${2:-}
if [ -z "$STRING" ]; then
echo $ERR_MSG
exit 1
fi
}

View File

@ -9,17 +9,17 @@ install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
OS_STDOUT_NOCAPTURE=False
OS_STDERR_NOCAPTURE=False
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py testr --testr-args='{posargs}'
whitelist_externals = flake8
[testenv:venv]
commands = {posargs}
[testenv:pep8]
commands = flake8
commands =
flake8
bashate tools/ospopulate.bash tools/utils.bash
[flake8]
# E501 line too long