Clean up bashate failures

Also create tools/run-bashate.sh to wrap a find command to search for
files to run bashate on, and use it in tox.

Change-Id: I5ab07425f566a556f158a4b76b00aa35f9fb4385
This commit is contained in:
K Jonathan Harker 2014-09-29 13:28:19 -07:00
parent b4a308c445
commit 2f03cf35e5
28 changed files with 192 additions and 260 deletions

@ -12,7 +12,7 @@ GIT_HOST="review.openstack.org:29418"
PROJECT_PREFIX="openstack"
if [[ ! -e ${PROJECT} ]]; then
git clone ssh://$GIT_HOST/$PROJECT_PREFIX/$PROJECT
git clone ssh://$GIT_HOST/$PROJECT_PREFIX/$PROJECT
fi
cd $PROJECT
git checkout master
@ -23,15 +23,15 @@ git fetch origin +refs/meta/*:refs/remotes/meta/*
# Checkout or create the meta/openstack/release branch
if ! { git branch -a |grep ^[[:space:]]*remotes/meta/openstack/release$; }
then
git checkout --orphan release
# Delete everything so the first commit is truly empty:
git rm -rf .
# git rm -rf leaves submodule directories:
find -maxdepth 1 -not -regex '\./\.git\(/.*\)?' -not -name . -exec rm -fr {} \;
ls -la
git checkout --orphan release
# Delete everything so the first commit is truly empty:
git rm -rf .
# git rm -rf leaves submodule directories:
find -maxdepth 1 -not -regex '\./\.git\(/.*\)?' -not -name . -exec rm -fr {} \;
ls -la
else
git branch -D release || /bin/true
git checkout -b release remotes/meta/openstack/release
git branch -D release || /bin/true
git checkout -b release remotes/meta/openstack/release
fi
# Normally a branch name will just be a file, but we can have branches
@ -40,12 +40,11 @@ fi
mkdir -p `dirname $BRANCH`
# Read and update the value for the branch
if [ -e "$BRANCH" ]
then
echo "Current contents of ${BRANCH}:"
cat "${BRANCH}"
if [ -e "$BRANCH" ]; then
echo "Current contents of ${BRANCH}:"
cat "${BRANCH}"
else
echo "${BRANCH} does not exist. Creating it."
echo "${BRANCH} does not exist. Creating it."
fi
echo "Updating ${BRANCH} to read $VALUE"

@ -15,8 +15,7 @@
# under the License.
# Initial transifex setup
function setup_translation ()
{
function setup_translation {
# Track in HAS_CONFIG whether we run "tx init" since calling it
# will add the file .tx/config - and "tx set" might update it. If
# "tx set" updates .tx/config, we need to handle the file if it
@ -31,8 +30,7 @@ function setup_translation ()
}
# Setup a project for transifex
function setup_project ()
{
function setup_project {
local project=$1
# Transifex project name does not include "."
@ -45,8 +43,7 @@ function setup_project ()
}
# Setup project horizon for transifex
function setup_horizon ()
{
function setup_horizon {
local project=horizon
# Horizon JavaScript Translations
@ -72,8 +69,7 @@ function setup_horizon ()
}
# Set global variable DocFolder for manuals projects
function init_manuals ()
{
function init_manuals {
project=$1
DocFolder="doc"
@ -84,46 +80,38 @@ function init_manuals ()
# Setup project manuals projects (api-site, openstack-manuals,
# operations-guide) for transifex
function setup_manuals ()
{
function setup_manuals {
local project=$1
# Generate pot one by one
for FILE in ${DocFolder}/*
do
for FILE in ${DocFolder}/*; do
# Skip non-directories
if [ ! -d $FILE ]
then
if [ ! -d $FILE ]; then
continue
fi
DOCNAME=${FILE#${DocFolder}/}
# Ignore directories that will not get translated
if [ "$DOCNAME" == "www" -o "$DOCNAME" == "tools" -o "$DOCNAME" == "generated" -o "$DOCNAME" == "publish-docs" ]
then
if [ "$DOCNAME" == "www" -o "$DOCNAME" == "tools" -o "$DOCNAME" == "generated" -o "$DOCNAME" == "publish-docs" ]; then
continue
fi
# Skip glossary in all repos besides openstack-manuals.
if [ "$project" != "openstack-manuals" -a "$DOCNAME" == "glossary" ]
then
if [ "$project" != "openstack-manuals" -a "$DOCNAME" == "glossary" ]; then
continue
fi
# Minimum amount of translation done, 75 % by default.
PERC=75
if [ "$project" == "openstack-manuals" ]
then
if [ "$project" == "openstack-manuals" ]; then
# The common and glossary directories are used by the
# other guides, let's be more liberal here since teams
# might only translate the files used by a single
# guide. We use 8 % since that downloads the currently
# translated files.
if [ "$DOCNAME" == "common" -o "$DOCNAME" == "glossary" ]
then
if [ "$DOCNAME" == "common" -o "$DOCNAME" == "glossary" ]; then
PERC=8
fi
fi
# Update the .pot file
./tools/generatepot ${DOCNAME}
if [ -f ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot ]
then
if [ -f ${DocFolder}/${DOCNAME}/locale/${DOCNAME}.pot ]; then
# Add all changed files to git
git add ${DocFolder}/${DOCNAME}/locale/*
# Set auto-local
@ -138,8 +126,7 @@ function setup_manuals ()
}
# Setup git so that git review works
function setup_git ()
{
function setup_git {
git config user.name "OpenStack Proposal Bot"
git config user.email "openstack-infra@lists.openstack.org"
git config gitreview.username "proposal-bot"
@ -147,8 +134,7 @@ function setup_git ()
# Setup project so that git review works, sets global variable
# COMMIT_MSG.
function setup_review ()
{
function setup_review {
FULL_PROJECT=$(grep project .gitreview | cut -f2 -d= |sed -e 's/\.git$//')
COMMIT_MSG="Imported Translations from Transifex"
@ -199,19 +185,16 @@ EOF
}
# Propose patch using COMMIT_MSG
function send_patch ()
{
function send_patch {
# Revert any changes done to .tx/config
if [ $HAS_CONFIG -eq 1 ]
then
if [ $HAS_CONFIG -eq 1 ]; then
git reset -q .tx/config
git checkout -- .tx/config
fi
# Don't send a review if nothing has changed.
if [ `git diff --cached |wc -l` -gt 0 ]
then
if [ `git diff --cached |wc -l` -gt 0 ]; then
# Commit and review
git commit -F- <<EOF
$COMMIT_MSG
@ -222,8 +205,7 @@ EOF
}
# Setup global variables LEVELS and LKEYWORDS
function setup_loglevel_vars ()
{
function setup_loglevel_vars {
# Strings for various log levels
LEVELS="info warning error critical"
# Keywords for each log level:
@ -236,8 +218,7 @@ function setup_loglevel_vars ()
# Setup transifex configuration for log level message translation.
# Needs variables setup via setup_loglevel_vars.
function setup_loglevel_project ()
{
function setup_loglevel_project {
project=$1
# Transifex project name does not include "."
@ -246,8 +227,7 @@ function setup_loglevel_project ()
for level in $LEVELS ; do
# Bootstrapping: Create file if it does not exist yet,
# otherwise "tx set" will fail.
if [ ! -e ${project}/locale/${project}-log-${level}.pot ]
then
if [ ! -e ${project}/locale/${project}-log-${level}.pot ]; then
touch ${project}/locale/${project}-log-${level}.pot
fi
tx set --auto-local -r ${tx_project}.${tx_project}-log-${level}-translations \
@ -260,8 +240,7 @@ function setup_loglevel_project ()
# Run extract_messages for user visible messages and log messages.
# Needs variables setup via setup_loglevel_vars.
function extract_messages_log ()
{
function extract_messages_log {
project=$1
# Update the .pot files
@ -274,8 +253,7 @@ function extract_messages_log ()
}
# Setup project django_openstack_auth for transifex
function setup_django_openstack_auth ()
{
function setup_django_openstack_auth {
tx set --auto-local -r horizon.djangopo \
"openstack_auth/locale/<lang>/LC_MESSAGES/django.po" \
--source-lang en \
@ -284,11 +262,9 @@ function setup_django_openstack_auth ()
}
# Filter out files that we do not want to commit
function filter_commits ()
{
function filter_commits {
# Don't add new empty files.
for f in `git diff --cached --name-only --diff-filter=A`
do
for f in `git diff --cached --name-only --diff-filter=A`; do
# Files should have at least one non-empty msgid string.
if ! grep -q 'msgid "[^"]' "$f" ; then
git reset -q "$f"
@ -301,16 +277,14 @@ function filter_commits ()
# comment lines, or diff file information.
# Also, don't send files if only .pot files would be changed.
PO_CHANGE=0
for f in `git diff --cached --name-only`
do
for f in `git diff --cached --name-only`; do
# It's ok if the grep fails
set +e
changed=$(git diff --cached "$f" \
| egrep -v "(POT-Creation-Date|Project-Id-Version|PO-Revision-Date)" \
| egrep -c "^([-+][^-+#])")
set -e
if [ $changed -eq 0 ]
then
if [ $changed -eq 0 ]; then
git reset -q "$f"
git checkout -- "$f"
# Check for all files endig with ".po"

@ -1,9 +1,8 @@
#!/bin/bash -xe
if [ -z "$PROJECT" ]
then
echo '$PROJECT not set.'
exit 1
if [ -z "$PROJECT" ]; then
echo '$PROJECT not set.'
exit 1
fi
case "$ZUUL_REFNAME" in
@ -33,8 +32,7 @@ tarball="$(echo dist/$PROJECT*.tar.gz)"
version="${tarball%.tar.gz}"
version="${version#*$PROJECT-}"
base_version=$version
if [ -n "${EXTRAVERSION}" ]
then
if [ -n "${EXTRAVERSION}" ]; then
version="${version%~*}${EXTRAVERSION}~${version#*~}"
fi
tar xvzf "${tarball}"
@ -50,8 +48,7 @@ ln -s "${tarball}" "${PROJECT}_${version}.orig.tar.gz"
echo bzr checkout -r ${PACKAGING_REVNO} --lightweight $BZR_BRANCH $PROJECT-*
bzr checkout -r ${PACKAGING_REVNO} --lightweight $BZR_BRANCH $PROJECT-*
cd $PROJECT-*
if [ -d .git ]
then
if [ -d .git ]; then
PACKAGING_REVNO="$(git log --oneline | wc -l)"
rm -rf .git
else
@ -68,10 +65,8 @@ buildno=$BUILD_NUMBER
pkgversion="${version}-0ubuntu0~${series}${buildno}"
dch -b --force-distribution --v "${pkgversion}" "Automated PPA build. Packaging revision: ${PACKAGING_REVNO}." -D $series
dpkg-buildpackage -rfakeroot -S -sa -nc -k32EE128C
if ! [ "$DO_UPLOAD" = "no" ]
then
for ppa in $PPAS
do
if ! [ "$DO_UPLOAD" = "no" ]; then
for ppa in $PPAS; do
dput --force $ppa "../${PROJECT}_${pkgversion}_source.changes"
done
fi

@ -3,29 +3,24 @@
GERRIT_SITE=$1
GIT_ORIGIN=$2
if [ -z "$GERRIT_SITE" ]
then
echo "The gerrit site name (eg 'https://review.openstack.org') must be the first argument."
exit 1
if [ -z "$GERRIT_SITE" ]; then
echo "The gerrit site name (eg 'https://review.openstack.org') must be the first argument."
exit 1
fi
if [ -z "$ZUUL_URL" ]
then
echo "The ZUUL_URL must be provided."
exit 1
if [ -z "$ZUUL_URL" ]; then
echo "The ZUUL_URL must be provided."
exit 1
fi
if [ -z "$GIT_ORIGIN" ] || [ -n "$ZUUL_NEWREV" ]
then
if [ -z "$GIT_ORIGIN" ] || [ -n "$ZUUL_NEWREV" ]; then
GIT_ORIGIN="$GERRIT_SITE/p"
# git://git.openstack.org/
# https://review.openstack.org/p
fi
if [ -z "$ZUUL_REF" ]
then
if [ -n "$BRANCH" ]
then
if [ -z "$ZUUL_REF" ]; then
if [ -n "$BRANCH" ]; then
echo "No ZUUL_REF so using requested branch $BRANCH from origin."
ZUUL_REF=$BRANCH
# use the origin since zuul mergers have outdated branches
@ -36,18 +31,15 @@ then
fi
fi
if [ ! -z "$ZUUL_CHANGE" ]
then
if [ ! -z "$ZUUL_CHANGE" ]; then
echo "Triggered by: $GERRIT_SITE/$ZUUL_CHANGE"
fi
set -x
if [[ ! -e .git ]]
then
if [[ ! -e .git ]]; then
ls -a
rm -fr .[^.]* *
if [ -d /opt/git/$ZUUL_PROJECT/.git ]
then
if [ -d /opt/git/$ZUUL_PROJECT/.git ]; then
git clone file:///opt/git/$ZUUL_PROJECT .
else
git clone $GIT_ORIGIN/$ZUUL_PROJECT .
@ -56,8 +48,7 @@ fi
git remote set-url origin $GIT_ORIGIN/$ZUUL_PROJECT
# attempt to work around bugs 925790 and 1229352
if ! git remote update
then
if ! git remote update; then
echo "The remote update failed, so garbage collecting before trying again."
git gc
git remote update
@ -69,13 +60,11 @@ if ! git clean -x -f -d -q ; then
git clean -x -f -d -q
fi
if echo "$ZUUL_REF" | grep -q ^refs/tags/
then
if echo "$ZUUL_REF" | grep -q ^refs/tags/; then
git fetch --tags $ZUUL_URL/$ZUUL_PROJECT
git checkout $ZUUL_REF
git reset --hard $ZUUL_REF
elif [ -z "$ZUUL_NEWREV" ]
then
elif [ -z "$ZUUL_NEWREV" ]; then
git fetch $ZUUL_URL/$ZUUL_PROJECT $ZUUL_REF
git checkout FETCH_HEAD
git reset --hard FETCH_HEAD
@ -89,8 +78,7 @@ if ! git clean -x -f -d -q ; then
git clean -x -f -d -q
fi
if [ -f .gitmodules ]
then
if [ -f .gitmodules ]; then
git submodule init
git submodule sync
git submodule update --init

@ -20,43 +20,40 @@
case $( facter osfamily ) in
Debian)
PATTERN="sudo.*jenkins.*:.*incorrect password attempts"
OLDLOGFILE=/var/log/auth.log.1
LOGFILE=/var/log/auth.log
;;
PATTERN="sudo.*jenkins.*:.*incorrect password attempts"
OLDLOGFILE=/var/log/auth.log.1
LOGFILE=/var/log/auth.log
;;
RedHat)
PATTERN="sudo.*jenkins.*:.*command not allowed"
OLDLOGFILE=$( ls /var/log/secure-* | sort | tail -n1 )
LOGFILE=/var/log/secure
;;
PATTERN="sudo.*jenkins.*:.*command not allowed"
OLDLOGFILE=$( ls /var/log/secure-* | sort | tail -n1 )
LOGFILE=/var/log/secure
;;
esac
case "$1" in
pre)
rm -fr /tmp/jenkins-sudo-log
mkdir /tmp/jenkins-sudo-log
if [ -f $OLDLOGFILE ]
then
stat -c %Y $OLDLOGFILE > /tmp/jenkins-sudo-log/mtime-pre
else
echo "0" > /tmp/jenkins-sudo-log/mtime-pre
fi
grep -h "$PATTERN" $LOGFILE > /tmp/jenkins-sudo-log/pre
exit 0
;;
rm -fr /tmp/jenkins-sudo-log
mkdir /tmp/jenkins-sudo-log
if [ -f $OLDLOGFILE ]; then
stat -c %Y $OLDLOGFILE > /tmp/jenkins-sudo-log/mtime-pre
else
echo "0" > /tmp/jenkins-sudo-log/mtime-pre
fi
grep -h "$PATTERN" $LOGFILE > /tmp/jenkins-sudo-log/pre
exit 0
;;
post)
if [ -f $OLDLOGFILE ]
then
stat -c %Y $OLDLOGFILE > /tmp/jenkins-sudo-log/mtime-post
else
echo "0" > /tmp/jenkins-sudo-log/mtime-post
fi
if ! diff /tmp/jenkins-sudo-log/mtime-pre /tmp/jenkins-sudo-log/mtime-post > /dev/null
then
echo "diff"
grep -h "$PATTERN" $OLDLOGFILE > /tmp/jenkins-sudo-log/post
fi
grep -h "$PATTERN" $LOGFILE >> /tmp/jenkins-sudo-log/post
diff /tmp/jenkins-sudo-log/pre /tmp/jenkins-sudo-log/post
;;
if [ -f $OLDLOGFILE ]; then
stat -c %Y $OLDLOGFILE > /tmp/jenkins-sudo-log/mtime-post
else
echo "0" > /tmp/jenkins-sudo-log/mtime-post
fi
if ! diff /tmp/jenkins-sudo-log/mtime-pre /tmp/jenkins-sudo-log/mtime-post > /dev/null; then
echo "diff"
grep -h "$PATTERN" $OLDLOGFILE > /tmp/jenkins-sudo-log/post
fi
grep -h "$PATTERN" $LOGFILE >> /tmp/jenkins-sudo-log/post
diff /tmp/jenkins-sudo-log/pre /tmp/jenkins-sudo-log/post
;;
esac

@ -9,4 +9,4 @@ cat >bootstrap/environment.php <<EOF
});
EOF
curl -s https://getcomposer.org/installer | /usr/bin/php
php composer.phar install --prefer-dist
php composer.phar install --prefer-dist

@ -32,8 +32,7 @@ tx pull -a -f --minimum-perc=75
extract_messages_log "$PROJECT"
PO_FILES=`find ${PROJECT}/locale -name "${PROJECT}.po"`
if [ -n "$PO_FILES" ]
then
if [ -n "$PO_FILES" ]; then
# Use updated .pot file to update translations
python setup.py update_catalog --no-fuzzy-matching --ignore-obsolete=true
fi
@ -42,20 +41,19 @@ fi
# add the messages with the default keywords. Therefore use msgmerge
# directly.
for level in $LEVELS ; do
PO_FILES=`find ${PROJECT}/locale -name "${PROJECT}-log-${level}.po"`
if [ -n "$PO_FILES" ]
then
for f in $PO_FILES ; do
echo "Updating $f"
msgmerge --update --no-fuzzy-matching $f \
--backup=none \
${PROJECT}/locale/${PROJECT}-log-${level}.pot
# Remove obsolete entries
msgattrib --no-obsolete --force-po \
--output-file=${f}.tmp ${f}
mv ${f}.tmp ${f}
done
fi
PO_FILES=`find ${PROJECT}/locale -name "${PROJECT}-log-${level}.po"`
if [ -n "$PO_FILES" ]; then
for f in $PO_FILES ; do
echo "Updating $f"
msgmerge --update --no-fuzzy-matching $f \
--backup=none \
${PROJECT}/locale/${PROJECT}-log-${level}.pot
# Remove obsolete entries
msgattrib --no-obsolete --force-po \
--output-file=${f}.tmp ${f}
mv ${f}.tmp ${f}
done
fi
done
#

@ -29,8 +29,7 @@ tx pull -a -f --minimum-perc=75
# Update the .pot file
python setup.py extract_messages
PO_FILES=`find openstack_auth/locale -name '*.po'`
if [ -n "$PO_FILES" ]
then
if [ -n "$PO_FILES" ]; then
# Use updated .pot file to update translations
python setup.py update_catalog --no-fuzzy-matching --ignore-obsolete=true
fi

@ -33,11 +33,9 @@ setup_manuals "$PROJECT"
tx pull -a -f
# Add imported upstream translations to git
for FILE in ${DocFolder}/*
do
for FILE in ${DocFolder}/*; do
DOCNAME=${FILE#${DocFolder}/}
if [ -d ${DocFolder}/${DOCNAME}/locale ]
then
if [ -d ${DocFolder}/${DOCNAME}/locale ] ; then
git add ${DocFolder}/${DOCNAME}/locale/*
fi
done

@ -18,13 +18,12 @@ rm -f dist/*.tar.gz
tox -evenv python setup.py sdist
FILES=dist/*.tar.gz
for f in $FILES
do
echo "SHA1sum for $f:"
sha1sum $f | awk '{print $1}' > $f.sha1
cat $f.sha1
for f in $FILES; do
echo "SHA1sum for $f:"
sha1sum $f | awk '{print $1}' > $f.sha1
cat $f.sha1
echo "MD5sum for $f:"
md5sum $f | awk '{print $1}' > $f.md5
cat $f.md5
echo "MD5sum for $f:"
md5sum $f | awk '{print $1}' > $f.md5
cat $f.md5
done

@ -13,12 +13,11 @@
venv=$1
if [[ -z "$venv" ]]
then
echo "Usage: $?"
echo
echo "VENV: The tox environment to run (eg 'python27')"
exit 1
if [[ -z "$venv" ]]; then
echo "Usage: $?"
echo
echo "VENV: The tox environment to run (eg 'python27')"
exit 1
fi
cat /etc/image-hostname.txt
@ -33,8 +32,7 @@ result=$?
sudo /usr/local/jenkins/slave_scripts/jenkins-sudo-grep.sh post
sudoresult=$?
if [ $sudoresult -ne "0" ]
then
if [ $sudoresult -ne "0" ]; then
echo
echo "This test has failed because it attempted to execute commands"
echo "with sudo. See above for the exact commands used."
@ -45,8 +43,7 @@ fi
/usr/local/jenkins/slave_scripts/jenkins-oom-grep.sh post
oomresult=$?
if [ $oomresult -ne "0" ]
then
if [ $oomresult -ne "0" ]; then
echo
echo "This test has failed because it attempted to exceed configured"
echo "memory limits and was killed prior to completion. See above"

@ -69,8 +69,7 @@ fi
sudo /usr/local/jenkins/slave_scripts/jenkins-sudo-grep.sh post
sudoresult=$?
if [ $sudoresult -ne "0" ]
then
if [ $sudoresult -ne "0" ]; then
echo
echo "This test has failed because it attempted to execute commands"
echo "with sudo. See above for the exact commands used."
@ -81,8 +80,7 @@ fi
/usr/local/jenkins/slave_scripts/jenkins-oom-grep.sh post
oomresult=$?
if [ $oomresult -ne "0" ]
then
if [ $oomresult -ne "0" ]; then
echo
echo "This test has failed because it attempted to exceed configured"
echo "memory limits and was killed prior to completion. See above"
@ -92,11 +90,9 @@ then
fi
htmlreport=$(find . -name $NOSE_HTML_OUT_FILE)
if [ -f "$htmlreport" ]
then
if [ -f "$htmlreport" ]; then
passcount=$(grep -c 'tr class=.passClass' $htmlreport)
if [ $passcount -eq "0" ]
then
if [ $passcount -eq "0" ]; then
echo
echo "Zero tests passed, which probably means there was an error"
echo "parsing one of the python files, or that some other failure"

@ -19,11 +19,10 @@ tox -evenv pip install wheel
tox -evenv python setup.py bdist_wheel
FILES=dist/*.whl
for f in $FILES
do
echo -n "SHA1sum for $f: "
sha1sum $f | awk '{print $1}' | tee $f.sha1
for f in $FILES; do
echo -n "SHA1sum for $f: "
sha1sum $f | awk '{print $1}' | tee $f.sha1
echo -n "MD5sum for $f: "
md5sum $f | awk '{print $1}' | tee $f.md5
echo -n "MD5sum for $f: "
md5sum $f | awk '{print $1}' | tee $f.md5
done

@ -16,8 +16,7 @@
# The script is to push the updated English po to Transifex.
if [ ! `echo $ZUUL_REFNAME | grep master` ]
then
if [ ! `echo $ZUUL_REFNAME | grep master` ]; then
exit 0
fi
@ -34,8 +33,7 @@ python setup.py extract_messages
# Add all changed files to git
git add openstack_auth/locale/*
if [ ! `git diff-index --quiet HEAD --` ]
then
if [ ! `git diff-index --quiet HEAD --` ]; then
# Push .pot changes to transifex
tx --debug --traceback push -s
fi

@ -18,8 +18,7 @@
PROJECT="horizon"
if [ ! `echo $ZUUL_REFNAME | grep master` ]
then
if [ ! `echo $ZUUL_REFNAME | grep master` ]; then
exit 0
fi
@ -38,8 +37,7 @@ setup_horizon
git add ${PROJECT}/locale/en/LC_MESSAGES/*
git add openstack_dashboard/locale/en/LC_MESSAGES/*
if [ `git diff --cached | egrep -v "(POT-Creation-Date|^[\+\-]#|^\+{3}|^\-{3})" | egrep -c "^[\-\+]"` -gt 0 ]
then
if [ `git diff --cached | egrep -v "(POT-Creation-Date|^[\+\-]#|^\+{3}|^\-{3})" | egrep -c "^[\-\+]"` -gt 0 ]; then
# Push source file changes to transifex
tx --debug --traceback push -s
fi

@ -14,8 +14,7 @@
PROJECT=$1
if [ ! `echo $ZUUL_REFNAME | grep master` ]
then
if [ ! `echo $ZUUL_REFNAME | grep master` ]; then
exit 0
fi
@ -33,8 +32,7 @@ extract_messages_log "$PROJECT"
# Add all changed files to git
git add $PROJECT/locale/*
if [ ! `git diff-index --quiet HEAD --` ]
then
if [ ! `git diff-index --quiet HEAD --` ]; then
# Push .pot changes to transifex
# Transifex project name does not include "."

@ -18,8 +18,7 @@
PROJECT=$1
if [ ! `echo $ZUUL_REFNAME | grep master` ]
then
if [ ! `echo $ZUUL_REFNAME | grep master` ]; then
exit 0
fi
@ -32,8 +31,7 @@ setup_translation
setup_manuals "$PROJECT"
if [ ! `git diff --cached --quiet HEAD --` ]
then
if [ ! `git diff --cached --quiet HEAD --` ]; then
# Push .pot changes to transifex
tx --debug --traceback push -s
fi

@ -12,9 +12,10 @@ echo "Jenkins: Waiting for puppet to complete on all nodes"
DONE=0
while [ $DONE != 1 ]; do
DONE=1
for hostname in $HOSTS
do
if !(grep "$hostname $FINISH_RE" $LOGFILE >/dev/null); then DONE=0; fi
for hostname in $HOSTS; do
if !(grep "$hostname $FINISH_RE" $LOGFILE >/dev/null); then
DONE=0
fi
done
sleep 5
done

@ -88,7 +88,7 @@ DOMZERO_USER=domzero
# directory to ramdisk.
XSINST_DIRECTORY="/xsinst"
function main() {
function main {
case "$(get_state)" in
"START")
dump_disk_config
@ -146,7 +146,7 @@ function main() {
esac
}
function set_state() {
function set_state {
local state
state="$1"
@ -154,7 +154,7 @@ function set_state() {
echo "$state" > $STATE_FILE
}
function get_state() {
function get_state {
if [ -e "$STATE_FILE" ]; then
cat $STATE_FILE
else
@ -162,7 +162,7 @@ function get_state() {
fi
}
function create_resizing_initramfs_config() {
function create_resizing_initramfs_config {
cp "$THIS_DIR/xenserver_helper_initramfs_hook.sh" \
/usr/share/initramfs-tools/hooks/resize
chmod +x /usr/share/initramfs-tools/hooks/resize
@ -172,12 +172,12 @@ function create_resizing_initramfs_config() {
chmod +x /usr/share/initramfs-tools/scripts/local-premount/resize
}
function delete_resizing_initramfs_config() {
function delete_resizing_initramfs_config {
rm -f /usr/share/initramfs-tools/hooks/resize
rm -f /usr/share/initramfs-tools/scripts/local-premount/resize
}
function run_this_script_on_each_boot() {
function run_this_script_on_each_boot {
cat > /etc/init/xenserver.conf << EOF
start on stopped rc RUNLEVEL=[2345]
@ -189,13 +189,13 @@ end script
EOF
}
function create_done_file_on_appliance() {
function create_done_file_on_appliance {
while ! echo "sudo touch $FILE_TO_TOUCH_ON_COMPLETION" | bash_on_appliance; do
sleep 1
done
}
function download_xenserver_files() {
function download_xenserver_files {
local tgt
tgt="$1"
@ -203,7 +203,7 @@ function download_xenserver_files() {
wget -qO "$tgt" "$XENSERVER_ISO_URL"
}
function download_appliance() {
function download_appliance {
local appliance_url
appliance_url="$1"
@ -211,7 +211,7 @@ function download_appliance() {
wget -qO /root/staging_vm.xva "$appliance_url"
}
function print_answerfile() {
function print_answerfile {
local repository
local postinst
local xenserver_pass
@ -238,7 +238,7 @@ function print_answerfile() {
EOF
}
function print_postinst_file() {
function print_postinst_file {
local rclocal
rclocal="$1"
@ -252,7 +252,7 @@ cp /tmp/ramdisk/authorized_keys \$1/root/.ssh/
EOF
}
function print_rclocal() {
function print_rclocal {
cat << EOF
# This is the contents of the rc.local file on XenServer
mkdir -p /mnt/ubuntu
@ -263,7 +263,7 @@ mkdir -p $(dirname $INSTALL_DIR)
EOF
}
function create_ramdisk_contents() {
function create_ramdisk_contents {
local isofile
local target_dir
@ -280,7 +280,7 @@ function create_ramdisk_contents() {
"$XENSERVER_PASSWORD" > "$target_dir/answerfile.xml"
}
function extract_xs_installer() {
function extract_xs_installer {
local isofile
local targetpath
@ -300,7 +300,7 @@ function extract_xs_installer() {
umount $mountdir
}
function generate_xs_installer_grub_config() {
function generate_xs_installer_grub_config {
local bootfiles
local answerfile
@ -319,7 +319,7 @@ EOF
chmod +x /etc/grub.d/45_xs-install
}
function configure_grub() {
function configure_grub {
sed -ie 's/^GRUB_HIDDEN_TIMEOUT/#GRUB_HIDDEN_TIMEOUT/g' /etc/default/grub
sed -ie 's/^GRUB_HIDDEN_TIMEOUT_QUIET/#GRUB_HIDDEN_TIMEOUT_QUIET/g' /etc/default/grub
# sed -ie 's/^GRUB_TIMEOUT=.*$/GRUB_TIMEOUT=-1/g' /etc/default/grub
@ -327,11 +327,11 @@ function configure_grub() {
sed -ie 's/GRUB_DEFAULT=0/GRUB_DEFAULT=saved/g' /etc/default/grub
}
function set_xenserver_installer_as_nextboot() {
function set_xenserver_installer_as_nextboot {
grub-set-default "XenServer installer"
}
function store_cloud_settings() {
function store_cloud_settings {
local targetpath
targetpath="$1"
@ -345,7 +345,7 @@ NAMESERVERS=$(cat /etc/resolv.conf | grep nameserver | cut -d " " -f 2 | sort |
EOF
}
function store_authorized_keys() {
function store_authorized_keys {
local targetpath
targetpath="$1"
@ -353,13 +353,13 @@ function store_authorized_keys() {
cp /root/.ssh/authorized_keys $1
}
function wait_for_xapi() {
function wait_for_xapi {
while ! [ -e /var/run/xapi_init_complete.cookie ]; do
sleep 1
done
}
function forget_networking() {
function forget_networking {
xe host-management-disable
IFS=,
for vlan in $(xe vlan-list --minimal); do
@ -374,7 +374,7 @@ function forget_networking() {
unset IFS
}
function add_boot_config_for_ubuntu() {
function add_boot_config_for_ubuntu {
local ubuntu_bootfiles
local bootfiles
@ -398,7 +398,7 @@ label ubuntu
UBUNTU
}
function start_ubuntu_on_next_boot() {
function start_ubuntu_on_next_boot {
local bootfiles
bootfiles="$1"
@ -406,7 +406,7 @@ function start_ubuntu_on_next_boot() {
sed -ie 's,default xe-serial,default ubuntu,g' $bootfiles/extlinux.conf
}
function start_xenserver_on_next_boot() {
function start_xenserver_on_next_boot {
local bootfiles
bootfiles="$1"
@ -414,7 +414,7 @@ function start_xenserver_on_next_boot() {
sed -ie 's,default ubuntu,default xe-serial,g' $bootfiles/extlinux.conf
}
function mount_dom0_fs() {
function mount_dom0_fs {
local target
target="$1"
@ -423,13 +423,13 @@ function mount_dom0_fs() {
mount /dev/xvda2 $target
}
function wait_for_networking() {
function wait_for_networking {
while ! ping -c 1 xenserver.org > /dev/null 2>&1; do
sleep 1
done
}
function bash_on_appliance() {
function bash_on_appliance {
local vm_ip
local vm
@ -452,7 +452,7 @@ function bash_on_appliance() {
"$DOMZERO_USER@$vm_ip" bash -e -u -s -x -- "$@"
}
function configure_networking() {
function configure_networking {
local network_settings
network_settings="$1"
@ -576,7 +576,7 @@ EOF
cat $tmpdomzerokey >> /root/.ssh/authorized_keys
}
function transfer_settings_to_appliance() {
function transfer_settings_to_appliance {
local network_settings
network_settings="$1"
@ -585,7 +585,7 @@ function transfer_settings_to_appliance() {
/opt/xensource/libexec/interface-reconfigure rewrite
}
function dump_disk_config() {
function dump_disk_config {
echo "DUMPING Primary disk's configuration"
sfdisk -d /dev/xvda
}

@ -25,6 +25,6 @@ done
# install pip using get-pip
PIP_GET_PIP_URL=https://bootstrap.pypa.io/get-pip.py
if [ ! -f get-pip.py ] ; then
curl -O $PIP_GET_PIP_URL || wget $PIP_GET_PIP_URL
curl -O $PIP_GET_PIP_URL || wget $PIP_GET_PIP_URL
fi
sudo python get-pip.py

@ -21,12 +21,12 @@ mkdir -p ~/cache/pip
if [ -f /usr/bin/yum ]; then
sudo yum -y install python-devel make automake gcc gcc-c++ \
kernel-devel redhat-lsb-core
kernel-devel redhat-lsb-core
elif [ -f /usr/bin/apt-get ]; then
sudo DEBIAN_FRONTEND=noninteractive apt-get \
--option "Dpkg::Options::=--force-confold" \
--assume-yes install build-essential python-dev \
python-software-properties linux-headers-virtual linux-headers-`uname -r`
--option "Dpkg::Options::=--force-confold" \
--assume-yes install build-essential python-dev \
python-software-properties linux-headers-virtual linux-headers-`uname -r`
else
echo "Unsupported distro."
exit 1

@ -28,8 +28,7 @@ GIT_BASE=${GIT_BASE:-git://git.openstack.org}
export PUPPET_VERSION=${PUPPET_VERSION:-'2'}
sudo hostname $HOSTNAME
if [ -n "$HOSTNAME" ] && ! grep -q $HOSTNAME /etc/hosts
then
if [ -n "$HOSTNAME" ] && ! grep -q $HOSTNAME /etc/hosts ; then
echo "127.0.1.1 $HOSTNAME" | sudo tee -a /etc/hosts
fi

@ -20,7 +20,7 @@
# Enable precise-backports so we can install jq
if [ -f /usr/bin/apt-get ]; then
sudo sed -i -e 's/# \(deb .*precise-backports main \)/\1/g' \
/etc/apt/sources.list
/etc/apt/sources.list
sudo apt-get update
fi
@ -37,7 +37,7 @@ sudo pip install gear os-apply-config
# tests.
if [ -d /etc/sysconfig/network-scripts ]; then
sudo dd of=/etc/sysconfig/network-scripts/ifcfg-eth1 << EOF
sudo dd of=/etc/sysconfig/network-scripts/ifcfg-eth1 << EOF
DEVICE="eth1"
BOOTPROTO="dhcp"
ONBOOT="yes"
@ -46,13 +46,13 @@ PEERDNS="no"
EOF
elif [ -f /etc/network/interfaces ]; then
sudo dd of=/etc/network/interfaces oflag=append conv=notrunc << EOF
sudo dd of=/etc/network/interfaces oflag=append conv=notrunc << EOF
auto eth1
iface eth1 inet dhcp
EOF
# Workaround bug 1270646 for actual slaves
sudo dd of=/etc/network/interfaces.d/eth0.cfg oflag=append conv=notrunc << EOF
sudo dd of=/etc/network/interfaces.d/eth0.cfg oflag=append conv=notrunc << EOF
post-up ip link set mtu 1458 dev eth0
EOF

@ -4,7 +4,7 @@ set -e
PREREQ=""
prereqs () {
function prereqs {
echo "${PREREQ}"
}

@ -5,8 +5,7 @@ set -ex
PREREQ=""
# Output pre-requisites
prereqs()
{
function prereqs {
echo "$PREREQ"
}

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

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

@ -780,8 +780,6 @@ jobs:
voting: false
- name: gate-config-bashate
voting: false
- name: gate-project-config-bashate
voting: false
# TODO(rpodolyaka): make voting when the jobs pass on all SA versions
- name: gate-oslo.db-tox-sqla_08
voting: false