Merge "Clean up bashate failures"

This commit is contained in:
Jenkins 2014-10-20 18:35:44 +00:00 committed by Gerrit Code Review
commit 5dba0f5637
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,10 +20,8 @@ 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 ' '`

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

@ -24,4 +24,4 @@ ignore = E125,H
select = H231
[testenv:bashate]
commands = bashate -v
commands = {toxinidir}/tools/run-bashate.sh