From 2b113e1e29f0fca1a1026d4b90f3768668cc25d8 Mon Sep 17 00:00:00 2001 From: Ryan Brady Date: Thu, 24 Jul 2014 13:35:18 -0400 Subject: [PATCH] Fix dib-lint failures As part of an ongoing effort to apply more testing against elements, this patch provides fixes for most dib-lint failures outside of the set -o pipefail patch[1] including set options, indention, and file permissions. There are still a few indention errors left after this patch, but they should be ignored in a dib-lint patch soon to add additional exclusions. [1] Ib97e3a35dd0ee653f1298c9ffe6ea99cea9dfd55 Change-Id: Ibf3dfc5735752900598466b0a54342692ef77284 --- .../install.d/99-check_mk_local_checks | 14 +++++++------- .../pre-configure.d/97-check-mk-agent-iptables | 0 .../pre-install.d/00-cinder-disable-requiretty | 2 +- elements/devstack/block-device-size.d/10-size | 2 +- elements/devstack/install.d/52-image-toolchain | 2 +- elements/devstack/install.d/53-devstack | 2 +- elements/devstack/install.d/97-haveged | 2 +- elements/devstack/install.d/98-baremetal-network | 2 +- elements/devstack/install.d/99-ssh | 2 +- elements/heat-cfntools/install.d/05-heat-cfntools | 4 ++-- .../install.d/heat-source-install/10-heat-engine | 2 +- .../post-configure.d/79-heat-engine | 2 +- .../heat/install.d/heat-source-install/05-heat | 2 +- .../pre-install.d/00-ironic-disable-requiretty | 2 +- elements/jenkins/install.d/10-jenkins | 2 +- elements/jenkins/install.d/11-jenkins-plugins | 2 +- elements/jenkins/pre-install.d/10-jenkins | 2 +- .../install.d/nova-source-install/80-nova-compute | 2 +- .../10-openstack-clients-venv-dir.bash | 0 .../post-configure.d/16-base-opts-pacemaker | 0 elements/pypi-mirror/install.d/50-pypi-mirror | 2 +- .../sosreport/environment.d/90-sos-plugins-env | 0 elements/stackuser/install.d/50-user | 2 +- elements/tempest/tests2skip.py | 12 ++++++------ elements/tripleo-cd/configs/te_commonrc | 0 elements/tripleo-cd/configs/te_hp1rc | 0 elements/tripleo-cd/configs/te_localrc | 0 elements/tripleo-cd/configs/te_rh1rc | 0 .../tripleo-staging/pre-install.d/01-bleeding-edge | 2 +- 29 files changed, 33 insertions(+), 33 deletions(-) mode change 100644 => 100755 elements/check_mk-agent/os-refresh-config/pre-configure.d/97-check-mk-agent-iptables mode change 100644 => 100755 elements/openstack-clients/environment.d/10-openstack-clients-venv-dir.bash mode change 100644 => 100755 elements/pacemaker/os-refresh-config/post-configure.d/16-base-opts-pacemaker mode change 100644 => 100755 elements/sosreport/environment.d/90-sos-plugins-env mode change 100644 => 100755 elements/tripleo-cd/configs/te_commonrc mode change 100644 => 100755 elements/tripleo-cd/configs/te_hp1rc mode change 100644 => 100755 elements/tripleo-cd/configs/te_localrc mode change 100644 => 100755 elements/tripleo-cd/configs/te_rh1rc diff --git a/elements/check_mk-agent/install.d/99-check_mk_local_checks b/elements/check_mk-agent/install.d/99-check_mk_local_checks index 04b991226..118bcff73 100755 --- a/elements/check_mk-agent/install.d/99-check_mk_local_checks +++ b/elements/check_mk-agent/install.d/99-check_mk_local_checks @@ -7,17 +7,17 @@ set -o pipefail if [[ "rhel rhel7 centos fedora" =~ "$DISTRO_NAME" ]]; then - # we're running a RHEL-based distro, so we need to install to - # /usr/share/check-mk-agent/local - LOCAL_CHECK_ROOT=/usr/share/check-mk-agent/local + # we're running a RHEL-based distro, so we need to install to + # /usr/share/check-mk-agent/local + LOCAL_CHECK_ROOT=/usr/share/check-mk-agent/local else - # We're running a debian-based distro so we need to install - # to /usr/lib/check_mk_agent/local/ - LOCAL_CHECK_ROOT=/usr/lib/check_mk_agent/local + # We're running a debian-based distro so we need to install + # to /usr/lib/check_mk_agent/local/ + LOCAL_CHECK_ROOT=/usr/lib/check_mk_agent/local fi mkdir -p $LOCAL_CHECK_ROOT LOCAL_CHECK_SOURCE=$(dirname $0)/../check_mk_checks if [[ -d "${LOCAL_CHECK_SOURCE}" ]]; then - install -m 0755 -o root -g root $LOCAL_CHECK_SOURCE/* $LOCAL_CHECK_ROOT/ + install -m 0755 -o root -g root $LOCAL_CHECK_SOURCE/* $LOCAL_CHECK_ROOT/ fi diff --git a/elements/check_mk-agent/os-refresh-config/pre-configure.d/97-check-mk-agent-iptables b/elements/check_mk-agent/os-refresh-config/pre-configure.d/97-check-mk-agent-iptables old mode 100644 new mode 100755 diff --git a/elements/cinder/pre-install.d/00-cinder-disable-requiretty b/elements/cinder/pre-install.d/00-cinder-disable-requiretty index 24f4ec694..fafa19a54 100755 --- a/elements/cinder/pre-install.d/00-cinder-disable-requiretty +++ b/elements/cinder/pre-install.d/00-cinder-disable-requiretty @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -eu if [ -d /etc/sudoers.d ]; then echo "Defaults:cinder !requiretty" > /etc/sudoers.d/cinder-notty diff --git a/elements/devstack/block-device-size.d/10-size b/elements/devstack/block-device-size.d/10-size index d87822154..e2fce0a12 100755 --- a/elements/devstack/block-device-size.d/10-size +++ b/elements/devstack/block-device-size.d/10-size @@ -1,7 +1,7 @@ #!/bin/bash # Enforce a maximum size on the image size -set -e +set -eu if (( '16' '>' $DIB_IMAGE_SIZE )); then echo DIB_IMAGE_SIZE=16 diff --git a/elements/devstack/install.d/52-image-toolchain b/elements/devstack/install.d/52-image-toolchain index 1a6c612f2..f5542110c 100755 --- a/elements/devstack/install.d/52-image-toolchain +++ b/elements/devstack/install.d/52-image-toolchain @@ -3,7 +3,7 @@ # (also includes the bootstrap-from-devstack facilities needed until we have # full image mastering of openstack). -set -e +set -eu set -o xtrace install-packages git diff --git a/elements/devstack/install.d/53-devstack b/elements/devstack/install.d/53-devstack index 0060ebad4..2e48c5dc3 100755 --- a/elements/devstack/install.d/53-devstack +++ b/elements/devstack/install.d/53-devstack @@ -1,7 +1,7 @@ #!/bin/bash # Initialize devstack in the bootstrap image -set -e +set -eu set -o xtrace install-packages git diff --git a/elements/devstack/install.d/97-haveged b/elements/devstack/install.d/97-haveged index 1c1b2db8e..de9246355 100755 --- a/elements/devstack/install.d/97-haveged +++ b/elements/devstack/install.d/97-haveged @@ -1,7 +1,7 @@ #!/bin/bash # Install the haveged daemon so ssh config on startup isn't glacial. -set -e +set -eu set -o xtrace install-packages haveged diff --git a/elements/devstack/install.d/98-baremetal-network b/elements/devstack/install.d/98-baremetal-network index 286fcec92..318f3114a 100755 --- a/elements/devstack/install.d/98-baremetal-network +++ b/elements/devstack/install.d/98-baremetal-network @@ -1,7 +1,7 @@ #!/bin/bash # Configure eth1, the baremetal network. -set -e +set -eu set -o xtrace cat << EOF >> /etc/network/interfaces diff --git a/elements/devstack/install.d/99-ssh b/elements/devstack/install.d/99-ssh index 2134c1988..15fa78471 100755 --- a/elements/devstack/install.d/99-ssh +++ b/elements/devstack/install.d/99-ssh @@ -2,7 +2,7 @@ # Regenerate host keys now. XXX: Really should be a cloud-init task, should get # that working. -set -e +set -eu set -o xtrace dpkg-reconfigure openssh-server diff --git a/elements/heat-cfntools/install.d/05-heat-cfntools b/elements/heat-cfntools/install.d/05-heat-cfntools index 7fa066c88..83fb0bbe5 100755 --- a/elements/heat-cfntools/install.d/05-heat-cfntools +++ b/elements/heat-cfntools/install.d/05-heat-cfntools @@ -5,8 +5,8 @@ set -uex install-packages python-psutil gcc python-dev if [[ "fedora" = "$DISTRO_NAME" ]]; then - # Remove the pre-installed package version of heat-cfntools - yum remove -y heat-cfntools + # Remove the pre-installed package version of heat-cfntools + yum remove -y heat-cfntools fi VENV=/opt/stack/venvs/heat-cfntools diff --git a/elements/heat-engine/install.d/heat-source-install/10-heat-engine b/elements/heat-engine/install.d/heat-source-install/10-heat-engine index 590a95be5..4a3b17ef5 100755 --- a/elements/heat-engine/install.d/heat-source-install/10-heat-engine +++ b/elements/heat-engine/install.d/heat-source-install/10-heat-engine @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -eu install-packages python-mysqldb diff --git a/elements/heat-engine/os-refresh-config/post-configure.d/79-heat-engine b/elements/heat-engine/os-refresh-config/post-configure.d/79-heat-engine index a7cbf20e7..24a4a9687 100755 --- a/elements/heat-engine/os-refresh-config/post-configure.d/79-heat-engine +++ b/elements/heat-engine/os-refresh-config/post-configure.d/79-heat-engine @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eu os-svc-enable -n heat-engine diff --git a/elements/heat/install.d/heat-source-install/05-heat b/elements/heat/install.d/heat-source-install/05-heat index 4225770ba..b0bca9d78 100755 --- a/elements/heat/install.d/heat-source-install/05-heat +++ b/elements/heat/install.d/heat-source-install/05-heat @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -eu install-packages python-setuptools python-eventlet python-greenlet \ python-httplib2 python-iso8601 python-lxml python-sqlalchemy \ python-paste python-routes python-webob python-yaml libffi-dev diff --git a/elements/ironic/pre-install.d/00-ironic-disable-requiretty b/elements/ironic/pre-install.d/00-ironic-disable-requiretty index 460e3c37e..f3b184f61 100755 --- a/elements/ironic/pre-install.d/00-ironic-disable-requiretty +++ b/elements/ironic/pre-install.d/00-ironic-disable-requiretty @@ -1,5 +1,5 @@ #!/bin/bash -set -e +set -eu if [ -d /etc/sudoers.d ]; then echo "Defaults:ironic !requiretty" > /etc/sudoers.d/ironic-notty diff --git a/elements/jenkins/install.d/10-jenkins b/elements/jenkins/install.d/10-jenkins index e79e1cd19..161bc6b36 100755 --- a/elements/jenkins/install.d/10-jenkins +++ b/elements/jenkins/install.d/10-jenkins @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eu set -o xtrace install-packages jenkins diff --git a/elements/jenkins/install.d/11-jenkins-plugins b/elements/jenkins/install.d/11-jenkins-plugins index 754103afd..70a777846 100755 --- a/elements/jenkins/install.d/11-jenkins-plugins +++ b/elements/jenkins/install.d/11-jenkins-plugins @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eu set -o xtrace source $(dirname $0)/defaults diff --git a/elements/jenkins/pre-install.d/10-jenkins b/elements/jenkins/pre-install.d/10-jenkins index c5b049f95..aa4d479e8 100755 --- a/elements/jenkins/pre-install.d/10-jenkins +++ b/elements/jenkins/pre-install.d/10-jenkins @@ -1,7 +1,7 @@ #!/bin/bash # Add the Jenkins package archive -set -e +set -eu set -o xtrace wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add - diff --git a/elements/nova-compute/install.d/nova-source-install/80-nova-compute b/elements/nova-compute/install.d/nova-source-install/80-nova-compute index c63086667..a53995b1a 100755 --- a/elements/nova-compute/install.d/nova-source-install/80-nova-compute +++ b/elements/nova-compute/install.d/nova-source-install/80-nova-compute @@ -10,7 +10,7 @@ CONFIG_PARAMETERS="--config-dir /etc/nova" TEMPLATE_ROOT=$(dirname $0)/../os-apply-config if [ -d ${TEMPLATE_ROOT}/etc/nova/compute ]; then - CONFIG_PARAMETERS="${CONFIG_PARAMETERS} --config-dir /etc/nova/compute" + CONFIG_PARAMETERS="${CONFIG_PARAMETERS} --config-dir /etc/nova/compute" fi os-svc-daemon -i "$NOVA_VENV_DIR" -e "LIBVIRT_DEFAULT_URI=qemu:///system" nova-compute nova nova-compute "${CONFIG_PARAMETERS}" diff --git a/elements/openstack-clients/environment.d/10-openstack-clients-venv-dir.bash b/elements/openstack-clients/environment.d/10-openstack-clients-venv-dir.bash old mode 100644 new mode 100755 diff --git a/elements/pacemaker/os-refresh-config/post-configure.d/16-base-opts-pacemaker b/elements/pacemaker/os-refresh-config/post-configure.d/16-base-opts-pacemaker old mode 100644 new mode 100755 diff --git a/elements/pypi-mirror/install.d/50-pypi-mirror b/elements/pypi-mirror/install.d/50-pypi-mirror index bc7f54188..802c1dfdf 100755 --- a/elements/pypi-mirror/install.d/50-pypi-mirror +++ b/elements/pypi-mirror/install.d/50-pypi-mirror @@ -6,7 +6,7 @@ # not use this file except in compliance with the License. You may obtain # a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT diff --git a/elements/sosreport/environment.d/90-sos-plugins-env b/elements/sosreport/environment.d/90-sos-plugins-env old mode 100644 new mode 100755 diff --git a/elements/stackuser/install.d/50-user b/elements/stackuser/install.d/50-user index 16ad6e3dd..7d118e870 100755 --- a/elements/stackuser/install.d/50-user +++ b/elements/stackuser/install.d/50-user @@ -1,7 +1,7 @@ #!/bin/bash # Add the stack user we recommend folk use. -set -e +set -eu set -o xtrace useradd -m stack -s /bin/bash diff --git a/elements/tempest/tests2skip.py b/elements/tempest/tests2skip.py index 06adb3727..9cda2a085 100755 --- a/elements/tempest/tests2skip.py +++ b/elements/tempest/tests2skip.py @@ -7,7 +7,7 @@ # not use this file except in compliance with the License. You may obtain # a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT @@ -37,14 +37,14 @@ so the regular expression should account for that. For example, the following scenario: - run all the smoke tests and scenario tests, - but exclude the api.volume tests. + run all the smoke tests and scenario tests, + but exclude the api.volume tests. is implemented as: - +.*smoke - +tempest\.scenario - -tempest\.api\.volume.* + +.*smoke + +tempest\.scenario + -tempest\.api\.volume.* """ whitelist = [] diff --git a/elements/tripleo-cd/configs/te_commonrc b/elements/tripleo-cd/configs/te_commonrc old mode 100644 new mode 100755 diff --git a/elements/tripleo-cd/configs/te_hp1rc b/elements/tripleo-cd/configs/te_hp1rc old mode 100644 new mode 100755 diff --git a/elements/tripleo-cd/configs/te_localrc b/elements/tripleo-cd/configs/te_localrc old mode 100644 new mode 100755 diff --git a/elements/tripleo-cd/configs/te_rh1rc b/elements/tripleo-cd/configs/te_rh1rc old mode 100644 new mode 100755 diff --git a/elements/tripleo-staging/pre-install.d/01-bleeding-edge b/elements/tripleo-staging/pre-install.d/01-bleeding-edge index 449446f30..174710463 100755 --- a/elements/tripleo-staging/pre-install.d/01-bleeding-edge +++ b/elements/tripleo-staging/pre-install.d/01-bleeding-edge @@ -1,6 +1,6 @@ #!/bin/bash # Install bleeding edge tools instead of stable ones. -set -e +set -eu add-apt-repository -y ppa:tripleo/demo-staging