Clean up bashate failures

Fix all of the bashate failures.  Also, bashate will install its negative
tests in its virtualenv, so we need to generate a list of files to pass to
bashate that excludes .tox/

Change-Id: I55559bf6137f705aec9a7f277928ad8d4cadc2ca
This commit is contained in:
K Jonathan Harker 2014-09-03 19:06:12 -07:00
parent e30f37376d
commit 948aff1f02
10 changed files with 283 additions and 284 deletions

View File

@ -68,19 +68,16 @@ fi
MODULE_LIST=`puppet module list`
# Transition away from old things
if [ -d /etc/puppet/modules/vcsrepo/.git ]
then
if [ -d /etc/puppet/modules/vcsrepo/.git ]; then
rm -rf /etc/puppet/modules/vcsrepo
fi
# Install all the modules
for MOD in ${!MODULES[*]} ; do
# If the module at the current version does not exist upgrade or install it.
if ! echo $MODULE_LIST | grep "$MOD ([^v]*v${MODULES[$MOD]}" >/dev/null 2>&1
then
if ! echo $MODULE_LIST | grep "$MOD ([^v]*v${MODULES[$MOD]}" >/dev/null 2>&1 ; then
# Attempt module upgrade. If that fails try installing the module.
if ! puppet module upgrade $MOD --version ${MODULES[$MOD]} >/dev/null 2>&1
then
if ! puppet module upgrade $MOD --version ${MODULES[$MOD]} >/dev/null 2>&1 ; then
# This will get run in cron, so silence non-error output
puppet module install $MOD --version ${MODULES[$MOD]} >/dev/null
fi

View File

@ -20,16 +20,14 @@ php -q poller_reindex_hosts.php --id=$HOST_ID
php -q add_graphs.php --list-graph-templates \
--host-template-id=$HOST_TEMPLATE_ID | \
while read line
do
if echo $line | grep "Known" >/dev/null || [ "$line" == "" ]
then
while read line ; do
if echo $line | grep "Known" >/dev/null || [ "$line" == "" ] ; then
continue
fi
TEMPLATE_ID=`echo $line | cut -f 1 -d ' '`
php -q add_graphs.php --host-id=$HOST_ID --graph-type=cg \
--graph-template-id=$TEMPLATE_ID
done
done
function add_ds_graph {
TEMPLATE_NAME=$1

View File

@ -1,4 +1,4 @@
function print_help() {
function print_help {
echo "Usage: `basename $0` command [options]"
echo ""
echo "Commands:"
@ -8,7 +8,7 @@ function print_help() {
echo ""
}
function site_init() {
function site_init {
if [ ! $1 ]; then
echo "ERROR: site parameter mandatory"
exit 1
@ -71,7 +71,7 @@ function site_init() {
ln -s $SITE_ROOT/slot0 $SITE_ROOT/w
}
function site_status() {
function site_status {
if [ ! $1 ]; then
echo "ERROR: site parameter mandatory"
exit 1
@ -101,18 +101,18 @@ function site_status() {
fi
}
function fetch_catalog() {
function fetch_catalog {
curl --silent $SOURCE_ROOT > $SITE_ROOT/releases.lst
grep -q "^<!DOCTYPE HTML PUBLIC" $SITE_ROOT/releases.lst
}
function catalog_get_version() {
function catalog_get_version {
RAW_LINE=`cat $SITE_ROOT/releases.lst | grep "$RELEASE_NAME" | sed "s/<[^>]\+>//g" | sed -r "s/^$RELEASE_NAME//"`
RELEASE_DATE=`echo $RAW_LINE | awk '{ print $1 " " $2}'`
echo $RELEASE_DATE
}
function site_update() {
function site_update {
if [ ! $1 ]; then
echo "ERROR: missing site parameter"
exit 1

4
tools/run-bashate.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
ROOT=$(readlink -fn $(dirname $0)/.. )
find $ROOT -not -wholename \*.tox/\* -and \( -name \*.sh -or -name \*rc -or -name functions\* \) -print0 | xargs -0 bashate -v

View File

@ -50,4 +50,4 @@ commands =
{toxinidir}/tools/run-layout.sh openstack-infra config
[testenv:bashate]
commands = bashate -v
commands = {toxinidir}/tools/run-bashate.sh