Silence bashate

The remaining bashate warnings was E042:
 The return value of "local" is always 0; errors in subshells
 used for declaration are thus hidden and will not trigger "set
 -e".

Fix the few cases this triggered so that we don't get confused anymore
about the message.

Remove -v from bashate invocation, we don't need to print out all the
filenames anymore.

Change-Id: I47991a7040c8b9183bc72cce8e5d95b2cec7e6c5
This commit is contained in:
Andreas Jaeger 2018-03-26 09:12:29 +02:00
parent 4b4905a31f
commit c0b40b37e0
5 changed files with 19 additions and 8 deletions

View File

@ -37,7 +37,9 @@ function setup_commit_message {
CHANGE_NUM=""
# See if there is an open change, if so, get the change id for the
# existing change for use in the commit message.
local change_info=$(ssh -p 29418 $USERNAME@review.openstack.org \
local change_info
change_info=$(ssh -p 29418 $USERNAME@review.openstack.org \
gerrit query --current-patch-set status:open project:$PROJECT \
owner:$USERNAME branch:$BRANCH topic:$TOPIC)
CHANGE_NUM=$(echo "$change_info" | grep "^ number:" | awk '{print $2}')

View File

@ -632,7 +632,8 @@ function cleanup_log_files {
for i in $(find $modulename -name *.po) ; do
# We do not store the log level files anymore, remove them
# from git.
local bi=$(basename $i)
local bi
bi=$(basename $i)
for level in $levels ; do
if [[ "$bi" == "$modulename-log-$level.po" ]] ; then
@ -724,7 +725,8 @@ function copy_pot {
for m in $all_modules ; do
for f in `find $m -name "*.pot" ` ; do
local fd=$(dirname $f)
local fd
fd=$(dirname $f)
mkdir -p $target/$fd
cp $f $target/$f
done

View File

@ -42,7 +42,9 @@ function cleanup_module {
function git_add_po_files {
local target_dir=$1
local po_file_count=`find $1 -name *.po | wc -l`
local po_file_count
po_file_count=`find $1 -name *.po | wc -l`
if [ $po_file_count -ne 0 ]; then
git add $target_dir/*/*
@ -53,7 +55,9 @@ function git_add_po_files {
function git_add_json_files {
local target_dir=$1
local json_file_count=`find $1 -name '*.json' | wc -l`
local json_file_count
json_file_count=`find $1 -name '*.json' | wc -l`
if [ $json_file_count -ne 0 ]; then
git add $target_dir/*
@ -127,7 +131,9 @@ function propose_python_django {
local version=$2
# Check for empty directory and exit early
local content=$(ls -A $modulename/locale/)
local content
content=$(ls -A $modulename/locale/)
if [[ "$content" == "" ]] ; then
return

View File

@ -10,9 +10,10 @@ CONFIGS_LIST_BASE=$OLDPWD/$1
function check_team_acl {
local configs_dir="$1"
local configs_list=$(find $configs_dir -name "*.config")
local configs_list
local failure=0
configs_list=$(find $configs_dir -name "*.config")
for config in $configs_list; do
$OLDPWD/tools/normalize_acl.py $config all > $TMPDIR/normalized

View File

@ -7,4 +7,4 @@
ROOT=$(readlink -fn $(dirname $0)/.. )
find $ROOT -not -path '*playbooks/legacy/*' -and -not -wholename \*.tox/\* \
-and -not -wholename \*.test/\* \
-and -name \*.sh -print0 | xargs -0 bashate -v --ignore E006,E011
-and -name \*.sh -print0 | xargs -0 bashate --ignore E006,E011