Update to bashate 0.3.2
Bashate 0.3.2 has a few new checks -- firstly make sure some of the
plugins have #!/bin/bash, and fix up a couple of "local" changes that
were missed by I9c8912a8fd596535589b207d7fc553b9d951d3fe
Change-Id: I9e4b1c0dc9e0f709d8e76f9c9bf1c9478b2605ed
diff --git a/functions-common b/functions-common
index 42555a9..ceefd44 100644
--- a/functions-common
+++ b/functions-common
@@ -1746,7 +1746,8 @@
# extras.d in an unsupported way which will let us track
# unsupported usage in the gate.
local exceptions="50-ironic.sh 60-ceph.sh 80-tempest.sh"
- local extra=$(basename $extra_plugin_file_name)
+ local extra
+ extra=$(basename $extra_plugin_file_name)
if [[ ! ( $exceptions =~ "$extra" ) ]]; then
deprecated "extras.d support is being removed in Mitaka-1"
deprecated "jobs for project $extra will break after that point"
@@ -2184,14 +2185,21 @@
# global counter for that name. Errors if that clock had not
# previously been started.
function time_stop {
- local name=$1
- local start_time=${START_TIME[$name]}
+ local name
+ local end_time
+ local elpased_time
+ local total
+ local start_time
+
+ name=$1
+ start_time=${START_TIME[$name]}
+
if [[ -z "$start_time" ]]; then
die $LINENO "Trying to stop the clock on $name, but it was never started"
fi
- local end_time=$(date +%s)
- local elapsed_time=$(($end_time - $start_time))
- local total=${TOTAL_TIME[$name]:-0}
+ end_time=$(date +%s)
+ elapsed_time=$(($end_time - $start_time))
+ total=${TOTAL_TIME[$name]:-0}
# reset the clock so we can start it in the future
START_TIME[$name]=""
TOTAL_TIME[$name]=$(($total + $elapsed_time))
diff --git a/lib/heat b/lib/heat
index 85fdaa1..f3f0548 100644
--- a/lib/heat
+++ b/lib/heat
@@ -239,7 +239,8 @@
run_process h-eng "$HEAT_BIN_DIR/heat-engine --config-file=$HEAT_CONF"
# If the site is not enabled then we are in a grenade scenario
- local enabled_site_file=$(apache_site_config_for heat-api)
+ local enabled_site_file
+ enabled_site_file=$(apache_site_config_for heat-api)
if [ -f ${enabled_site_file} ] && [ "$HEAT_USE_MOD_WSGI" == "True" ]; then
enable_apache_site heat-api
enable_apache_site heat-api-cfn
@@ -284,9 +285,12 @@
# _config_heat_apache_wsgi() - Set WSGI config files of Heat
function _config_heat_apache_wsgi {
- local heat_apache_conf=$(apache_site_config_for heat-api)
- local heat_cfn_apache_conf=$(apache_site_config_for heat-api-cfn)
- local heat_cloudwatch_apache_conf=$(apache_site_config_for heat-api-cloudwatch)
+ local heat_apache_conf
+ heat_apache_conf=$(apache_site_config_for heat-api)
+ local heat_cfn_apache_conf
+ heat_cfn_apache_conf=$(apache_site_config_for heat-api-cfn)
+ local heat_cloudwatch_apache_conf
+ heat_cloudwatch_apache_conf=$(apache_site_config_for heat-api-cloudwatch)
local heat_ssl=""
local heat_certfile=""
local heat_keyfile=""
diff --git a/lib/neutron_plugins/services/firewall b/lib/neutron_plugins/services/firewall
index 61a148e..3496da8 100644
--- a/lib/neutron_plugins/services/firewall
+++ b/lib/neutron_plugins/services/firewall
@@ -1,3 +1,5 @@
+#!/bin/bash
+
# Neutron firewall plugin
# ---------------------------
diff --git a/lib/neutron_plugins/services/loadbalancer b/lib/neutron_plugins/services/loadbalancer
index 34190f9..7865f6f 100644
--- a/lib/neutron_plugins/services/loadbalancer
+++ b/lib/neutron_plugins/services/loadbalancer
@@ -1,3 +1,5 @@
+#!/bin/bash
+
# Neutron loadbalancer plugin
# ---------------------------
diff --git a/lib/neutron_plugins/services/metering b/lib/neutron_plugins/services/metering
index 37ba019..c75ab19 100644
--- a/lib/neutron_plugins/services/metering
+++ b/lib/neutron_plugins/services/metering
@@ -1,3 +1,5 @@
+#!/bin/bash
+
# Neutron metering plugin
# ---------------------------
diff --git a/lib/neutron_plugins/services/vpn b/lib/neutron_plugins/services/vpn
index 4d6a2bf..c0e7457 100644
--- a/lib/neutron_plugins/services/vpn
+++ b/lib/neutron_plugins/services/vpn
@@ -1,3 +1,5 @@
+#!/bin/bash
+
# Neutron VPN plugin
# ---------------------------
diff --git a/lib/neutron_thirdparty/vmware_nsx b/lib/neutron_thirdparty/vmware_nsx
index 03853a9..e182fca 100644
--- a/lib/neutron_thirdparty/vmware_nsx
+++ b/lib/neutron_thirdparty/vmware_nsx
@@ -1,2 +1,4 @@
+#!/bin/bash
+
# REVISIT(roeyc): this file left empty so that 'enable_service vmware_nsx'
# continues to work.
diff --git a/tox.ini b/tox.ini
index 0df9877..9279455 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,7 +9,7 @@
[testenv:bashate]
deps =
- {env:BASHATE_INSTALL_PATH:bashate==0.3.1}
+ {env:BASHATE_INSTALL_PATH:bashate==0.3.2}
whitelist_externals = bash
commands = bash -c "find {toxinidir} \
-not \( -type d -name .?\* -prune \) \ # prune all 'dot' dirs
@@ -20,12 +20,13 @@
-not -name \*.md \
\( \
-name \*.sh -or \
- -name \*rc -or \
+ -name \*.orig -or \
+ -name \*rc -or \ # openrc files, etc
-name functions\* -or \
-wholename \*/inc/\* -or \ # /inc files and
-wholename \*/lib/\* \ # /lib files are shell, but
\) \ # have no extension
- -print0 | xargs -0 bashate -v -iE006"
+ -print0 | xargs -0 bashate -v -iE006 -eE005,E042"
[testenv:docs]
deps =