Make bashate E005,E042 error and ignore E006
This commit makes two bashate rules E005 and E042 treat as error and
ignores E006. It is difficult to keep E006 rule because bash scripts
tend to be long naturally. Both E005 and E042 are good to be errors
since it should be safer.
These additions can be seen in devstack[0] too.
E005: file does not begin with #! or have a .sh prefix
E006: check for lines longer than 79 columns
E042: local declaration hides errors
[0] https://opendev.org/openstack/devstack/src/commit/0fc6b2c5a87a1884bf3cff086081b3a253cd9302/tox.ini#L35
Change-Id: I56c017569aa8660648764502cce5adfe2e946a58
diff --git a/tools/verify-ipv6-only-deployments.sh b/tools/verify-ipv6-only-deployments.sh
index 90807a3..2596395 100755
--- a/tools/verify-ipv6-only-deployments.sh
+++ b/tools/verify-ipv6-only-deployments.sh
@@ -15,10 +15,14 @@
source $TOP_DIR/openrc admin admin
function verify_devstack_ipv6_setting {
- local _service_host=$(echo $SERVICE_HOST | tr -d [])
- local _host_ipv6=$(echo $HOST_IPV6 | tr -d [])
- local _service_listen_address=$(echo $SERVICE_LISTEN_ADDRESS | tr -d [])
- local _service_local_host=$(echo $SERVICE_LOCAL_HOST | tr -d [])
+ local _service_host=''
+ _service_host=$(echo $SERVICE_HOST | tr -d [])
+ local _host_ipv6=''
+ _host_ipv6=$(echo $HOST_IPV6 | tr -d [])
+ local _service_listen_address=''
+ _service_listen_address=$(echo $SERVICE_LISTEN_ADDRESS | tr -d [])
+ local _service_local_host=''
+ _service_local_host=$(echo $SERVICE_LOCAL_HOST | tr -d [])
if [[ "$SERVICE_IP_VERSION" != 6 ]]; then
echo $SERVICE_IP_VERSION "SERVICE_IP_VERSION is not set to 6 which is must for devstack to deploy services with IPv6 address."
exit 1
@@ -61,9 +65,11 @@
local all_ipv6=True
endpoints=$(openstack endpoint list -f value -c URL)
for endpoint in ${endpoints}; do
- local endpoint_address=$(echo "$endpoint" | awk -F/ '{print $3}' | awk -F] '{print $1}')
+ local endpoint_address=''
+ endpoint_address=$(echo "$endpoint" | awk -F/ '{print $3}' | awk -F] '{print $1}')
endpoint_address=$(echo $endpoint_address | tr -d [])
- local is_endpoint_ipv6=$(python3 -c 'import oslo_utils.netutils as nutils; print(nutils.is_valid_ipv6("'$endpoint_address'"))')
+ local is_endpoint_ipv6=''
+ is_endpoint_ipv6=$(python3 -c 'import oslo_utils.netutils as nutils; print(nutils.is_valid_ipv6("'$endpoint_address'"))')
if [[ "$is_endpoint_ipv6" != "True" ]]; then
all_ipv6=False
echo $endpoint ": This is not ipv6 endpoint which means corresponding service is not listening on IPv6 address."