diskimage-builder element cleanups for dib-lint

Since I6c5a962260741dcf6f89da9a33b96372a719b7b0 dib has had a
standardised method for ensuring consistency of tracing and error
detection.  Bring the tracing for these elements up to that standard,
but maintain the status-quo of flags such as "-e" and "pipefail" by
adding ignore flags where appropriate (we can update these separately
to avoid breakage)

Other minor changes are alphabetical-ordering in the element-deps
files and permissions on prepare-node script

With this, "tox -edib" passes

Change-Id: Ibba1dadb9e819f94294c9d583b83ff698252f93f
This commit is contained in:
Ian Wienand 2015-10-01 14:44:06 +10:00
parent aef075e7e4
commit 90c53a8ded
23 changed files with 108 additions and 11 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash -xe #!/bin/bash
# Copyright (C) 2015 OpenStack Foundation # Copyright (C) 2015 OpenStack Foundation
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
@ -16,5 +16,11 @@
# This is in /usr instead of /usr/local due to this bug on precise: # This is in /usr instead of /usr/local due to this bug on precise:
# https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588 # https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e
sudo -H virtualenv /usr/bindep-env sudo -H virtualenv /usr/bindep-env
sudo -H /usr/bindep-env/bin/pip install bindep sudo -H /usr/bindep-env/bin/pip install bindep

View File

@ -1,4 +1,4 @@
#!/bin/bash -xe #!/bin/bash
# Copyright (C) 2011-2015 OpenStack Foundation # Copyright (C) 2011-2015 OpenStack Foundation
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
@ -15,6 +15,12 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e
if [[ ${YUM:-yum} == "dnf" ]]; then if [[ ${YUM:-yum} == "dnf" ]]; then
echo "*** caching disabled for dnf" echo "*** caching disabled for dnf"
echo "*** see https://etherpad.openstack.org/p/infra-f22" echo "*** see https://etherpad.openstack.org/p/infra-f22"

View File

@ -26,6 +26,10 @@
# Most of it should be removed when we can source and call the # Most of it should be removed when we can source and call the
# functions directly # functions directly
# dib-lint: disable=setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu set -eu
GIT_BASE=${GIT_BASE:-git://git.openstack.org} GIT_BASE=${GIT_BASE:-git://git.openstack.org}

View File

@ -20,6 +20,10 @@
# cache data so that the later cloning of all of the OpenStack repos # cache data so that the later cloning of all of the OpenStack repos
# won't bomb out # won't bomb out
# dib-lint: disable=setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu set -eu
sudo rm -rf $TMP_MOUNT_PATH/opt/git/openstack-dev/devstack sudo rm -rf $TMP_MOUNT_PATH/opt/git/openstack-dev/devstack

View File

@ -15,6 +15,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e set -e
if [[ ${YUM:-yum} == "dnf" ]]; then if [[ ${YUM:-yum} == "dnf" ]]; then

View File

@ -15,7 +15,11 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set -eux # dib-lint: disable=setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
TEMPEST_DIR=/opt/git/openstack/tempest TEMPEST_DIR=/opt/git/openstack/tempest

View File

@ -1,3 +1,3 @@
puppet
cache-devstack cache-devstack
nodepool-base nodepool-base
puppet

View File

@ -15,6 +15,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e set -e
export SUDO='true' export SUDO='true'

View File

@ -15,7 +15,11 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
set -ex # dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e
# Nodepool expects this dir to exist when it boots slaves. # Nodepool expects this dir to exist when it boots slaves.
# Nodepool writes environment info to this dir. We set the mode # Nodepool writes environment info to this dir. We set the mode

View File

@ -19,6 +19,10 @@
# for properly handling grub. All we need to do here is get our values # for properly handling grub. All we need to do here is get our values
# in to the files. # in to the files.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e set -e
# Limit all test slaves to 8GB of memory so that larger flavors with more # Limit all test slaves to 8GB of memory so that larger flavors with more

View File

@ -15,6 +15,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# dib-lint: disable=set setu setpipefail indent
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e set -e
NODEPOOL_STATIC_NAMESERVER=${NODEPOOL_STATIC_NAMESERVER:-8.8.8.8} NODEPOOL_STATIC_NAMESERVER=${NODEPOOL_STATIC_NAMESERVER:-8.8.8.8}

View File

@ -1,4 +1,4 @@
#!/bin/bash -xe #!/bin/bash
# Copyright (C) 2014 Hewlett-Packard Development Company, L.P. # Copyright (C) 2014 Hewlett-Packard Development Company, L.P.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
@ -15,4 +15,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e
echo $DIB_IMAGE_NAME > /etc/image-hostname.txt echo $DIB_IMAGE_NAME > /etc/image-hostname.txt

View File

@ -1,4 +1,4 @@
#!/bin/bash -xe #!/bin/bash
# Copyright (C) 2015 Hewlett-Packard Development Company, L.P. # Copyright (C) 2015 Hewlett-Packard Development Company, L.P.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
@ -12,6 +12,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. # implied.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e
# Make all cloud-init data sources match rackspace- only attempt to look # Make all cloud-init data sources match rackspace- only attempt to look
# at ConfigDrive, not at metadata service. This is not needed if there # at ConfigDrive, not at metadata service. This is not needed if there
# is no cloud-init # is no cloud-init

View File

@ -1,4 +1,4 @@
#!/bin/bash -xe #!/bin/bash
# Copyright (C) 2015 Rackspace Australia # Copyright (C) 2015 Rackspace Australia
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
@ -12,6 +12,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. # implied.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e
# Create a virtualenv for zuul-swift-logs # Create a virtualenv for zuul-swift-logs
# This is in /usr instead of /usr/local due to this bug on precise: # This is in /usr instead of /usr/local due to this bug on precise:
# https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588 # https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588

View File

@ -1,4 +1,4 @@
#!/bin/bash -xe #!/bin/bash
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
@ -12,6 +12,12 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. # implied.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e
# Create a virtualenv for os-testr (which contains subunit2html) # Create a virtualenv for os-testr (which contains subunit2html)
# This is in /usr instead of /usr/local due to this bug on precise: # This is in /usr instead of /usr/local due to this bug on precise:
# https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588 # https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588

View File

@ -1,4 +1,4 @@
#!/bin/bash -xe #!/bin/bash
# Copyright (C) 2014 Hewlett-Packard Development Company, L.P. # Copyright (C) 2014 Hewlett-Packard Development Company, L.P.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
@ -16,6 +16,12 @@
# This is in /usr instead of /usr/local due to this bug on precise: # This is in /usr instead of /usr/local due to this bug on precise:
# https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588 # https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/839588
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e
git clone /opt/git/openstack-infra/zuul /tmp/zuul git clone /opt/git/openstack-infra/zuul /tmp/zuul
sudo virtualenv /usr/zuul-env sudo virtualenv /usr/zuul-env
sudo -H /usr/zuul-env/bin/pip install /tmp/zuul sudo -H /usr/zuul-env/bin/pip install /tmp/zuul

View File

@ -15,6 +15,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e set -e
chown -R jenkins:jenkins /home/jenkins chown -R jenkins:jenkins /home/jenkins

1
nodepool/elements/puppet/bin/prepare-node Normal file → Executable file
View File

@ -15,6 +15,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# dib-lint: disable=setu setpipefail dibdebugtrace indent
set -e set -e
SUDO=${SUDO:-true} SUDO=${SUDO:-true}

View File

@ -1,3 +1,3 @@
source-repositories
cache-url cache-url
openstack-repos openstack-repos
source-repositories

View File

@ -15,6 +15,10 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e set -e
# Unset the download cache for this invocation to prevent bleed from build host # Unset the download cache for this invocation to prevent bleed from build host

View File

@ -20,6 +20,10 @@
# does an apt-get update to hit those servers which may not have the uptime # does an apt-get update to hit those servers which may not have the uptime
# of our local mirrors. # of our local mirrors.
# dib-lint: disable=sete setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e set -e
OS_FAMILY=$(facter osfamily) OS_FAMILY=$(facter osfamily)

View File

@ -20,4 +20,10 @@
# need to do things like update the locatedb or the mandb or rotate logs # need to do things like update the locatedb or the mandb or rotate logs
# or really any of those things. We only want code running here that we want # or really any of those things. We only want code running here that we want
# here. # here.
# dib-lint: disable=sete setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
rm -f /etc/cron.{monthly,weekly,daily,hourly,d}/* rm -f /etc/cron.{monthly,weekly,daily,hourly,d}/*

View File

@ -20,6 +20,10 @@
# in a chroot, we're actually not running the right kernel for its assumptions # in a chroot, we're actually not running the right kernel for its assumptions
# to work. # to work.
# dib-lint: disable=setu setpipefail
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -e set -e
# If lsb_release is missing, just do nothing. # If lsb_release is missing, just do nothing.