Merge "Fix linters issues and enable tox/zuul linters job as gate"

This commit is contained in:
Zuul 2018-09-05 16:16:26 +00:00 committed by Gerrit Code Review
commit b913f3ec37
15 changed files with 551 additions and 565 deletions

View File

@ -1,5 +1,7 @@
- project:
check:
jobs:
- openstack-tox-linters:
voting: false
- openstack-tox-linters
gate:
jobs:
- openstack-tox-linters

View File

@ -50,8 +50,7 @@ for subgit in $SUBGITS; do
# check if destination branch already exists
echo "$subgit"
branch_check=`git branch -a --list $NEW_BRANCH`
if [ -z "$branch_check" ]
then
if [ -z "$branch_check" ]; then
echo "Creating $NEW_BRANCH"
git checkout $OLD_BRANCH
git checkout -b $NEW_BRANCH
@ -60,8 +59,7 @@ for subgit in $SUBGITS; do
echo "$NEW_BRANCH already exists"
fi
tag_check=`git tag -l $NEW_TAG`
if [ -z "$tag_check" ]
then
if [ -z "$tag_check" ]; then
echo "Creating $NEW_TAG"
# create tag
git checkout $NEW_BRANCH
@ -76,11 +74,3 @@ for subgit in $SUBGITS; do
done
echo "All done. branches and tags are pushed"

View File

@ -21,8 +21,7 @@ for subgit in $SUBGITS; do
# check if destination branch already exists
echo "$subgit"
branch_check=`git branch -a --list $branch`
if [ -z "$branch_check" ]
then
if [ -z "$branch_check" ]; then
echo "Creating branch $branch"
git checkout -b $branch
if [ $? != 0 ] ; then
@ -37,8 +36,7 @@ for subgit in $SUBGITS; do
fi
tag_check=`git tag -l $tag`
if [ -z "$tag_check" ]
then
if [ -z "$tag_check" ]; then
echo "Creating tag $tag"
git tag $tag
if [ $? != 0 ] ; then

View File

@ -17,8 +17,7 @@ for subgit in $SUBGITS; do
pushd $subgit > /dev/null
tag_check=`git tag -l $tag`
if [ -z "$tag_check" ]
then
if [ -z "$tag_check" ]; then
echo "Creating tag $tag"
git tag $tag
if [ $? != 0 ] ; then

View File

@ -72,8 +72,7 @@ function install_deps {
echo "Debug: List of deps to resolve: ${DEP_LIST}"
if [ -z "${DEP_LIST}" ]
then
if [ -z "${DEP_LIST}" ]; then
return 0
fi
@ -155,8 +154,7 @@ function install_deps {
>&2 echo "Installing PKG=$PKG PKG_FILE=$PKG_FILE PKG_REL_PATH=$PKG_REL_PATH PKG_PATH=$PKG_PATH from repo $REPOID"
cp $PKG_PATH .
if [ $? -ne 0 ]
then
if [ $? -ne 0 ]; then
>&2 echo " Here's what I have to work with..."
>&2 echo " TMPDIR=$TMP_DIR repoquery -c $YUM --repoid=$REPOID --arch=x86_64,noarch --resolve $PKG --qf=\"%{name} %{name}-%{version}-%{release}.%{arch}.rpm %{relativepath}\""
>&2 echo " PKG=$PKG PKG_FILE=$PKG_FILE REPO_PATH=$REPO_PATH PKG_REL_PATH=$PKG_REL_PATH PKG_PATH=$PKG_PATH"
@ -184,8 +182,7 @@ function install_deps {
>&2 echo ""
}
function check_all_explicit_deps_installed
{
function check_all_explicit_deps_installed {
PKGS_TO_CHECK=" "
while read PKG_TO_ADD
@ -205,8 +202,7 @@ function check_all_explicit_deps_installed
fi
done < $TMPFILE
if [ -z "$PKGS_TO_CHECK" ]
then
if [ -z "$PKGS_TO_CHECK" ]; then
>&2 echo "All explicitly specified packages resolved!"
else
>&2 echo "Could not resolve packages: $PKGS_TO_CHECK"

View File

@ -25,8 +25,7 @@ function install_deps {
echo "Debug: List of deps to resolve: ${DEP_LIST}"
if [ -z "${DEP_LIST}" ]
then
if [ -z "${DEP_LIST}" ]; then
return 0
fi
@ -74,8 +73,7 @@ function install_deps {
>&2 echo "Installing PKG=$PKG PKG_FILE=$PKG_FILE PKG_REL_PATH=$PKG_REL_PATH PKG_PATH=$PKG_PATH from repo $REPOID"
cp $PKG_PATH .
if [ $? -ne 0 ]
then
if [ $? -ne 0 ]; then
>&2 echo " Here's what I have to work with..."
>&2 echo " TMPDIR=$TMP_DIR repoquery -c $YUM --repoid=$REPOID --arch=x86_64,noarch --resolve $PKG --qf=\"%{name} %{name}-%{version}-%{release}.%{arch}.rpm %{relativepath}\""
>&2 echo " PKG=$PKG PKG_FILE=$PKG_FILE REPO_PATH=$REPO_PATH PKG_REL_PATH=$PKG_REL_PATH PKG_PATH=$PKG_PATH"
@ -104,8 +102,7 @@ function install_deps {
>&2 echo ""
}
function check_all_explicit_deps_installed
{
function check_all_explicit_deps_installed {
PKGS_TO_CHECK=" "
while read PKG_TO_ADD
@ -127,8 +124,7 @@ function check_all_explicit_deps_installed
fi
done < $TMPFILE
if [ -z "$PKGS_TO_CHECK" ]
then
if [ -z "$PKGS_TO_CHECK" ]; then
>&2 echo "All explicitly specified packages resolved!"
else
>&2 echo "Could not resolve packages: $PKGS_TO_CHECK"

View File

@ -27,9 +27,7 @@ export GIT_LIST=$(git_list "$(dirname "${MY_REPO}")")
# GIT_LIST_REL: A list of root directories for all the gits under $MY_REPO/..
# as relative paths.
export GIT_LIST_REL=$(for p in $GIT_LIST; do
echo .${p#$(dirname ${MY_REPO})};
done)
export GIT_LIST_REL=$(for p in $GIT_LIST; do echo .${p#$(dirname ${MY_REPO})}; done)
#

View File

@ -2,13 +2,13 @@
## this script is called by "update-pxe-network-installer" and run in "sudo"
## created by Yong Hu (yong.hu@intel.com), 05/24/2018
function clean_rootfs() {
function clean_rootfs {
rootfs_dir=$1
echo "--> remove old files in original rootfs"
conf="$(ls ${rootfs_dir}/etc/ld.so.conf.d/kernel-*.conf)"
echo "conf basename = $(basename $conf)"
old_version="tbd"
if [ -f $conf ];then
if [ -f $conf ]; then
old_version="$(echo $(basename $conf) | rev | cut -d'.' -f2- | rev | cut -d'-' -f2-)"
fi
echo "old version is $old_version"
@ -51,7 +51,9 @@ fi
work_dir=$1
mode=$2
output_dir=$work_dir/output
if [ ! -d $output_dir ];then mkdir -p $output_dir; fi
if [ ! -d $output_dir ]; then
mkdir -p $output_dir;
fi
if [ "$mode" != "std" ] && [ "$mode" != "rt" ]; then
echo "ERROR: wrong kernel mode, must be std or rt"
@ -191,7 +193,9 @@ fi
echo $ORIG_SQUASHFS
mount -o loop -t squashfs $ORIG_SQUASHFS $work_dir/squashfs.mnt
if [ ! -d ./LiveOS ];then mkdir -p ./LiveOS ; fi
if [ ! -d ./LiveOS ]; then
mkdir -p ./LiveOS
fi
echo "--> copy rootfs.img from original squashfs.img to LiveOS folder"
cp -f ./squashfs.mnt/LiveOS/rootfs.img ./LiveOS/.

View File

@ -12,6 +12,9 @@ setenv = VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
[testenv:linters]
# ignore below cases
# E006 Line too long
# E010: Do not on same line as it commands
whitelist_externals = bash
commands =
bash -c "find {toxinidir} \
@ -20,7 +23,7 @@ commands =
-not -name \*~ \
-not -name \*.md \
-name \*.sh \
-print0 | xargs -0 bashate -v"
-print0 | xargs --no-run-if-empty -0 bashate -v -e 'E*' -i E006,E010"
bash -c "find {toxinidir} \
\( -name middleware/io-monitor/recipes-common/io-monitor/io-monitor/io_monitor/test-tools/yaml/* -prune \) \
-o \( -name .tox -prune \) \