From 2042bf7394cda660ea49cc870307b4810a7d44a3 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Thu, 28 Jun 2018 17:28:18 -0500 Subject: [PATCH] Clean up formatting to pass linters job and make it voting Change-Id: I6e160137be0421880d5fb60b32098ecccc34c193 Signed-off-by: Dean Troyer --- .zuul.yaml | 6 +-- centos-mirror-tools/dl_rpms.sh | 60 ++++++++++++++------------ centos-mirror-tools/download_mirror.sh | 11 ++--- tb.sh | 10 ++--- toCOPY/finishSetup.sh | 2 +- tox.ini | 3 +- 6 files changed, 48 insertions(+), 44 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 3a27ad8b..7ccbd0a6 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -2,9 +2,7 @@ - project: check: jobs: - - openstack-tox-linters: - voting: false + - openstack-tox-linters gate: jobs: - - openstack-tox-linters: - voting: false + - openstack-tox-linters diff --git a/centos-mirror-tools/dl_rpms.sh b/centos-mirror-tools/dl_rpms.sh index d2ebadc9..c413437f 100755 --- a/centos-mirror-tools/dl_rpms.sh +++ b/centos-mirror-tools/dl_rpms.sh @@ -6,10 +6,14 @@ if [ $# -lt 3 ]; then echo "$0 " echo "rpm_list: a list of RPM files to be downloaded." echo "match_level: value could be L1, L2 or L3:" - echo " L1: use name, major version and minor version, for example, using vim-7.4.160-2.el7 to search vim-7.4.160-2.el7.src.rpm" - echo " L2: use name and major version, for example, using vim-7.4.160 to search vim-7.4.160-2.el7.src.rpm" - echo " L3: use name, for example, using vim to search vim-7.4.160-2.el7.src.rpm" - echo "from_where: where to download the RPMs: 'centos'from CentOS Repos, otherwise from 3rd-party websets" + echo " L1: use name, major version and minor version:" + echo " vim-7.4.160-2.el7 to search vim-7.4.160-2.el7.src.rpm" + echo " L2: use name and major version:" + echo " using vim-7.4.160 to search vim-7.4.160-2.el7.src.rpm" + echo " L3: use name:" + echo " using vim to search vim-7.4.160-2.el7.src.rpm" + echo "from_where: where to download the RPMs: 'centos'from CentOS Repos," + echo "otherwise from 3rd-party websets" exit -1 fi @@ -85,38 +89,38 @@ download () { download_cmd="wget $rpm_url" SFILE=$rpm_name fi - echo "--> run: $download_cmd" + echo "--> run: $download_cmd" if [ "$_type" == "src" ]; then if [ ! -e $MDIR_SRC/$rpm_name ]; then - echo "Looking for $rpm_name" - if $download_cmd ; then - if ! mv -f $SFILE* $MDIR_SRC ; then - echo "FAILED to move $rpm_name" - echo $rpm_name >> $FAIL_MOVE_SRPMS - fi - echo $rpm_name >> $FOUND_SRPMS - else - echo $rpm_name >> $MISSING_SRPMS - fi + echo "Looking for $rpm_name" + if $download_cmd ; then + if ! mv -f $SFILE* $MDIR_SRC ; then + echo "FAILED to move $rpm_name" + echo $rpm_name >> $FAIL_MOVE_SRPMS + fi + echo $rpm_name >> $FOUND_SRPMS + else + echo $rpm_name >> $MISSING_SRPMS + fi else - echo "Already have ${MDIR_BIN}/${_type}/$rpm_name" - echo $rpm_name >> $FOUND_SRPMS + echo "Already have ${MDIR_BIN}/${_type}/$rpm_name" + echo $rpm_name >> $FOUND_SRPMS fi else ## noarch or x86_64 if [ ! -e ${MDIR_BIN}/${_type}/$rpm_name ]; then - echo "Looking for $rpm_name..." - if $download_cmd ; then + echo "Looking for $rpm_name..." + if $download_cmd ; then mkdir -p $MDIR_BIN/${_type} - if ! mv -f $SFILE* $MDIR_BIN/${_type}/ ; then - echo "FAILED to move $rpm_name" - echo $rpm_name >> $FAIL_MOVE_RPMS - fi - echo $rpm_name >> $FOUND_RPMS - else - echo $rpm_name >> $MISSING_RPMS - fi + if ! mv -f $SFILE* $MDIR_BIN/${_type}/ ; then + echo "FAILED to move $rpm_name" + echo $rpm_name >> $FAIL_MOVE_RPMS + fi + echo $rpm_name >> $FOUND_RPMS + else + echo $rpm_name >> $MISSING_RPMS + fi else - echo "Already have ${MDIR_BIN}/${_type}/$rpm_name" + echo "Already have ${MDIR_BIN}/${_type}/$rpm_name" echo $rpm_name >> $FOUND_RPMS fi fi diff --git a/centos-mirror-tools/download_mirror.sh b/centos-mirror-tools/download_mirror.sh index 24402a3d..1bd79b0d 100755 --- a/centos-mirror-tools/download_mirror.sh +++ b/centos-mirror-tools/download_mirror.sh @@ -35,13 +35,13 @@ if [ ! -e ./rpms_from_centos_repo.lst ];then exit -1 fi -$rpm_downloader ./rpms_from_centos_repo.lst L1 centos | tee ./logs/log_download_rpms_from_centos_L1.txt +$rpm_downloader ./rpms_from_centos_repo.lst L1 centos | tee ./logs/log_download_rpms_from_centos_L1.txt if [ $? == 0 ]; then echo "finish 1st round of RPM downloading successfully!" if [ -e "./output/centos_rpms_missing_L1.txt" ]; then missing_num=`wc -l ./output/centos_rpms_missing_L1.txt | cut -d " " -f1-1` if [ "$missing_num" != "0" ];then - echo "ERROR: -------RPMs missing $missing_num in yumdownloader wit L1 match ---------------" + echo "ERROR: -------RPMs missing $missing_num in yumdownloader with L1 match ---------------" fi #echo "start 2nd round of downloading Binary RPMs with L2 match criteria..." #$rpm_downloader ./output/centos_rpms_missing_L1.txt L2 centos | tee ./logs/log_download_rpms_from_centos_L2.txt @@ -56,7 +56,7 @@ if [ $? == 0 ]; then if [ -e "./output/centos_srpms_missing_L1.txt" ]; then missing_num=`wc -l ./output/centos_srpms_missing_L1.txt | cut -d " " -f1-1` if [ "$missing_num" != "0" ];then - echo "ERROR: --------- SRPMs missing $missing_num in yumdownloader wit L1 match ---------------" + echo "ERROR: --------- SRPMs missing $missing_num in yumdownloader with L1 match ---------------" fi #echo "start 2nd round of downloading Source RPMs with L2 match criteria..." #$rpm_downloader ./output/centos_srpms_missing_L1.txt L2 centos | tee ./logs/log_download_srpms_from_centos_L2.txt @@ -105,8 +105,9 @@ if [ $? == 0 ];then echo "step #3: done successfully" fi -echo "IMPORTANT: The following 3 files are just bootstrap versions. Based on them, the workable images" -echo "for StarlingX could be generated by running \"update-pxe-network-installer\" command after \"build-iso\"" +echo "IMPORTANT: The following 3 files are just bootstrap versions. Based" +echo "on them, the workable images for StarlingX could be generated by" +echo "running \"update-pxe-network-installer\" command after \"build-iso\"" echo " - out/stx-r1/CentOS/pike/Binary/LiveOS/squashfs.img" echo " - out/stx-r1/CentOS/pike/Binary/images/pxeboot/initrd.img" echo " - out/stx-r1/CentOS/pike/Binary/images/pxeboot/vmlinuz" diff --git a/tb.sh b/tb.sh index 42b77501..05a18caf 100755 --- a/tb.sh +++ b/tb.sh @@ -32,7 +32,7 @@ function exec_container { } function run_container { - # create localdisk + # create localdisk mkdir -p ${LOCALDISK}/designer/${USER}/${PROJECT} docker run -it --rm \ @@ -73,9 +73,9 @@ case $CMD in echo "MY_TC_RELEASE=${MY_TC_RELEASE}" echo "MY_REPO_ROOT_DIR=${MY_REPO_ROOT_DIR}" ;; - exec) - exec_container - ;; + exec) + exec_container + ;; run) run_container ;; @@ -87,7 +87,7 @@ case $CMD in ;; *) echo "Unknown command: $CMD" - usage + usage exit 1 ;; esac diff --git a/toCOPY/finishSetup.sh b/toCOPY/finishSetup.sh index 1f443798..25144d12 100755 --- a/toCOPY/finishSetup.sh +++ b/toCOPY/finishSetup.sh @@ -2,7 +2,7 @@ # Load tbuilder configuration if [[ -r ${HOME}/buildrc ]]; then - source ${HOME}/buildrc + source ${HOME}/buildrc fi # start the web server diff --git a/tox.ini b/tox.ini index 0e4f4f83..e1fc1e54 100644 --- a/tox.ini +++ b/tox.ini @@ -21,11 +21,12 @@ commands = -print0 | xargs -0 yamllint" bash -c "find {toxinidir} \ -not \( -type d -name .?\* -prune \) \ + -not \( -type d -path {toxinidir}/toCOPY/cgcs_overlay -prune \) \ -type f \ -not -name \*~ \ -not -name \*.md \ -name \*.sh \ - -print0 | xargs -0 bashate -v" + -print0 | xargs -0 bashate -v -iE006" [testenv:venv] commands = {posargs}