Merge "Clean up bashate failures"
This commit is contained in:
commit
5dba0f5637
@ -68,19 +68,16 @@ fi
|
|||||||
MODULE_LIST=`puppet module list`
|
MODULE_LIST=`puppet module list`
|
||||||
|
|
||||||
# Transition away from old things
|
# Transition away from old things
|
||||||
if [ -d /etc/puppet/modules/vcsrepo/.git ]
|
if [ -d /etc/puppet/modules/vcsrepo/.git ]; then
|
||||||
then
|
|
||||||
rm -rf /etc/puppet/modules/vcsrepo
|
rm -rf /etc/puppet/modules/vcsrepo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install all the modules
|
# Install all the modules
|
||||||
for MOD in ${!MODULES[*]} ; do
|
for MOD in ${!MODULES[*]} ; do
|
||||||
# If the module at the current version does not exist upgrade or install it.
|
# 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
|
if ! echo $MODULE_LIST | grep "$MOD ([^v]*v${MODULES[$MOD]}" >/dev/null 2>&1 ; then
|
||||||
then
|
|
||||||
# Attempt module upgrade. If that fails try installing the module.
|
# Attempt module upgrade. If that fails try installing the module.
|
||||||
if ! puppet module upgrade $MOD --version ${MODULES[$MOD]} >/dev/null 2>&1
|
if ! puppet module upgrade $MOD --version ${MODULES[$MOD]} >/dev/null 2>&1 ; then
|
||||||
then
|
|
||||||
# This will get run in cron, so silence non-error output
|
# This will get run in cron, so silence non-error output
|
||||||
puppet module install $MOD --version ${MODULES[$MOD]} >/dev/null
|
puppet module install $MOD --version ${MODULES[$MOD]} >/dev/null
|
||||||
fi
|
fi
|
||||||
|
@ -20,16 +20,14 @@ php -q poller_reindex_hosts.php --id=$HOST_ID
|
|||||||
|
|
||||||
php -q add_graphs.php --list-graph-templates \
|
php -q add_graphs.php --list-graph-templates \
|
||||||
--host-template-id=$HOST_TEMPLATE_ID | \
|
--host-template-id=$HOST_TEMPLATE_ID | \
|
||||||
while read line
|
while read line ; do
|
||||||
do
|
if echo $line | grep "Known" >/dev/null || [ "$line" == "" ] ; then
|
||||||
if echo $line | grep "Known" >/dev/null || [ "$line" == "" ]
|
|
||||||
then
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
TEMPLATE_ID=`echo $line | cut -f 1 -d ' '`
|
TEMPLATE_ID=`echo $line | cut -f 1 -d ' '`
|
||||||
php -q add_graphs.php --host-id=$HOST_ID --graph-type=cg \
|
php -q add_graphs.php --host-id=$HOST_ID --graph-type=cg \
|
||||||
--graph-template-id=$TEMPLATE_ID
|
--graph-template-id=$TEMPLATE_ID
|
||||||
done
|
done
|
||||||
|
|
||||||
function add_ds_graph {
|
function add_ds_graph {
|
||||||
TEMPLATE_NAME=$1
|
TEMPLATE_NAME=$1
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function print_help() {
|
function print_help {
|
||||||
echo "Usage: `basename $0` command [options]"
|
echo "Usage: `basename $0` command [options]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Commands:"
|
echo "Commands:"
|
||||||
@ -8,7 +8,7 @@ function print_help() {
|
|||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
function site_init() {
|
function site_init {
|
||||||
if [ ! $1 ]; then
|
if [ ! $1 ]; then
|
||||||
echo "ERROR: site parameter mandatory"
|
echo "ERROR: site parameter mandatory"
|
||||||
exit 1
|
exit 1
|
||||||
@ -71,7 +71,7 @@ function site_init() {
|
|||||||
ln -s $SITE_ROOT/slot0 $SITE_ROOT/w
|
ln -s $SITE_ROOT/slot0 $SITE_ROOT/w
|
||||||
}
|
}
|
||||||
|
|
||||||
function site_status() {
|
function site_status {
|
||||||
if [ ! $1 ]; then
|
if [ ! $1 ]; then
|
||||||
echo "ERROR: site parameter mandatory"
|
echo "ERROR: site parameter mandatory"
|
||||||
exit 1
|
exit 1
|
||||||
@ -101,18 +101,18 @@ function site_status() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function fetch_catalog() {
|
function fetch_catalog {
|
||||||
curl --silent $SOURCE_ROOT > $SITE_ROOT/releases.lst
|
curl --silent $SOURCE_ROOT > $SITE_ROOT/releases.lst
|
||||||
grep -q "^<!DOCTYPE HTML PUBLIC" $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//"`
|
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}'`
|
RELEASE_DATE=`echo $RAW_LINE | awk '{ print $1 " " $2}'`
|
||||||
echo $RELEASE_DATE
|
echo $RELEASE_DATE
|
||||||
}
|
}
|
||||||
|
|
||||||
function site_update() {
|
function site_update {
|
||||||
if [ ! $1 ]; then
|
if [ ! $1 ]; then
|
||||||
echo "ERROR: missing site parameter"
|
echo "ERROR: missing site parameter"
|
||||||
exit 1
|
exit 1
|
||||||
|
4
tools/run-bashate.sh
Executable file
4
tools/run-bashate.sh
Executable 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
|
2
tox.ini
2
tox.ini
@ -24,4 +24,4 @@ ignore = E125,H
|
|||||||
select = H231
|
select = H231
|
||||||
|
|
||||||
[testenv:bashate]
|
[testenv:bashate]
|
||||||
commands = bashate -v
|
commands = {toxinidir}/tools/run-bashate.sh
|
||||||
|
Loading…
x
Reference in New Issue
Block a user