Add bashate checks to pep8 step

Similarly to pep8 checks, this allows enforcing a consistent
style of the shell scripts accross modfications. For now
only the indentation is enforced to reduce code churn.

Closes-Bug: 1648099
Change-Id: Ie66cbe1aea4bd01a8bba8833ef6cbd2cff6a7c6a
This commit is contained in:
Dirk Mueller 2016-10-25 22:46:14 +02:00
parent 73c5f6ea4f
commit 80fc5a2d42
20 changed files with 118 additions and 113 deletions

View File

@ -53,10 +53,8 @@ echo "Allowed to introduce missing lines : ${ALLOWED_EXTRA_MISSING}"
echo "Missing lines in master : ${baseline_missing}"
echo "Missing lines in proposed change : ${current_missing}"
if [ $allowed_missing -ge $current_missing ];
then
if [ $baseline_missing -lt $current_missing ];
then
if [ $allowed_missing -ge $current_missing ]; then
if [ $baseline_missing -lt $current_missing ]; then
show_diff $baseline_report $current_report
echo "We believe you can test your code with 100% coverage!"
else

View File

@ -33,8 +33,7 @@ fi
$configure_docker_storage_driver
if [ "$DOCKER_STORAGE_DRIVER" = "overlay" ]; then
if [ $(echo -e "$(uname -r)\n3.18" | sort -V | head -1) \
= $(uname -r) ]; then
if [ $(echo -e "$(uname -r)\n3.18" | sort -V | head -1) = $(uname -r) ]; then
ERROR_MESSAGE="OverlayFS requires at least Linux kernel 3.18. Cluster node kernel version: $(uname -r)"
echo "ERROR: ${ERROR_MESSAGE}" >&2
sh -c "${WAIT_CURL} --data-binary '{\"status\": \"FAILURE\", \"reason\": \"${ERROR_MESSAGE}\"}'"

View File

@ -14,7 +14,7 @@ FLANNEL_CONFIG_SERVICE=/etc/systemd/system/flannel-config.service
FLANNEL_JSON=/etc/sysconfig/flannel-network.json
sed -i '
/^FLANNEL_ETCD=/ s|=.*|="http://'"$ETCD_SERVER_IP"':2379"|
/^FLANNEL_ETCD=/ s|=.*|="http://'"$ETCD_SERVER_IP"':2379"|
' $FLANNELD_CONFIG
. $FLANNELD_CONFIG

View File

@ -5,7 +5,7 @@
echo "Configuring ${NETWORK_DRIVER} network service ..."
if [ "$NETWORK_DRIVER" == "docker" ]; then
DOCKER_NETWORK_OPTIONS="--cluster-store etcd://$ETCD_SERVER_IP:2379\
DOCKER_NETWORK_OPTIONS="--cluster-store etcd://$ETCD_SERVER_IP:2379 \
--cluster-advertise $SWARM_NODE_IP:9379"
sed -i "/^DOCKER_NETWORK_OPTIONS=/ s#=.*#='$DOCKER_NETWORK_OPTIONS'#" \
/etc/sysconfig/docker-network

View File

@ -6,6 +6,7 @@
# ascii betical order.
bandit>=1.1.0 # Apache-2.0
bashate>=0.2 # Apache-2.0
coverage>=4.0 # Apache-2.0
doc8 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD

View File

@ -98,6 +98,13 @@ commands =
doc8 -e .rst specs/ doc/source/ contrib/ CONTRIBUTING.rst HACKING.rst README.rst
bash tools/flake8wrap.sh {posargs}
bandit -r magnum -x tests -n5 -ll
bash -c "find {toxinidir} \
-not \( -type d -name .?\* -prune \) \
-not \( -type d -name doc -prune \) \
-not \( -type d -name contrib -prune \) \
-type f \
-name \*.sh \
-print0 | xargs -0 bashate -v -iE006,E010,E042 -eE005"
[testenv:venv]
commands = {posargs}