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] 0fc6b2c5a8/tox.ini (L35)

Change-Id: I56c017569aa8660648764502cce5adfe2e946a58
This commit is contained in:
Masayuki Igawa 2019-08-02 13:44:49 +09:00
parent 236a14bf3c
commit fdd964494a
No known key found for this signature in database
GPG Key ID: 290F53EDC899BF89
2 changed files with 13 additions and 7 deletions

View File

@ -15,10 +15,14 @@ source $TOP_DIR/stackrc
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 @@ function verify_service_listen_address_is_ipv6 {
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."

View File

@ -327,7 +327,7 @@ commands = bash -c "find {toxinidir}/tools \
-not \( -type d -name .?\* -prune \) \
-type f \
-name \*.sh \
-print0 | xargs -0 bashate -v"
-print0 | xargs -0 bashate -v -eE005,E042 -i E006"
[testenv:pip-check-reqs]
# Do not install test-requirements as that will pollute the virtualenv for