Have bashate run for entire project

Before bashate was only running on the devstack/ directory. Have it
now run on the entire project for *.sh files.

Fix issues detected by bashate.

Also check the files:
    devstack/files/hooks/qemu
    devstack/lib/ironic

These files were located by doing:
    $ find openstack/ironic/ -not \( -type d -name .?\* -prune \) \
      -type f -not -name '*.sh' | xargs file | grep -i "shell script"

Change-Id: I238b7ab650781143fe8231e01250ab56120ff94f
This commit is contained in:
John L. Villalovos 2016-09-21 09:02:08 -07:00
parent 0e3b3e8671
commit 3cedd6f924
3 changed files with 13 additions and 20 deletions

View File

@ -17,13 +17,11 @@ TEMPDIR=`mktemp -d /tmp/${PROJECT_NAME}.XXXXXX`
trap "rm -rf $TEMPDIR" EXIT trap "rm -rf $TEMPDIR" EXIT
oslo-config-generator --config-file=${OSLO_CFGFILE_OPTION} --output-file ${TEMPDIR}/${CFGFILE_NAME} oslo-config-generator --config-file=${OSLO_CFGFILE_OPTION} --output-file ${TEMPDIR}/${CFGFILE_NAME}
if [ $? != 0 ] if [ $? != 0 ]; then
then
exit 1 exit 1
fi fi
if ! diff -u ${TEMPDIR}/${CFGFILE_NAME} ${CFGFILE} if ! diff -u ${TEMPDIR}/${CFGFILE_NAME} ${CFGFILE}; then
then
echo "${0##*/}: ${PROJECT_NAME}.conf.sample is not up to date." echo "${0##*/}: ${PROJECT_NAME}.conf.sample is not up to date."
echo "${0##*/}: Please run oslo-config-generator --config-file=${OSLO_CFGFILE_OPTION}" echo "${0##*/}: Please run oslo-config-generator --config-file=${OSLO_CFGFILE_OPTION}"
exit 1 exit 1

View File

@ -14,14 +14,9 @@
find "$@" -not \( -type d -name .?\* -prune \) \ find "$@" -not \( -type d -name .?\* -prune \) \
-type f \ -type f \
-not -name \*.swp \
-not -name \*~ \
-not -name \*.xml \
-not -name \*.template \
-not -name \*.py \
\( \ \( \
-name \*.sh -or \ -wholename \*/devstack/files/hooks/qemu -or \
-wholename \*/lib/\* -or \ -wholename \*/devstack/lib/ironic -or \
-wholename \*/tools/\* \ -name \*.sh \
\) \ \) \
-print0 | xargs -0 bashate -v -iE006 -eE005,E042 -print0 | xargs -0 bashate -v -iE006 -eE005,E042

View File

@ -26,7 +26,7 @@ commands =
bash tools/flake8wrap.sh {posargs} bash tools/flake8wrap.sh {posargs}
# Run bashate during pep8 runs to ensure violations are caught by # Run bashate during pep8 runs to ensure violations are caught by
# the check and gate queues. # the check and gate queues.
{toxinidir}/tools/run_bashate.sh {toxinidir}/devstack {toxinidir}/tools/run_bashate.sh {toxinidir}
# Check that .po and .pot files are valid: # Check that .po and .pot files are valid:
bash -c "find ironic -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null" bash -c "find ironic -type f -regex '.*\.pot?' -print0|xargs -0 -n 1 msgfmt --check-format -o /dev/null"
# Check the *.rst files # Check the *.rst files