From: Guillaume Lambert Date: Tue, 4 May 2021 08:25:50 +0000 (+0200) Subject: Fix: bashate E010 warnings X-Git-Tag: v0.63.1~4 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=40d61a6fd4fdc64240fc298e039d9f88215e5e40;p=releng%2Fglobal-jjb.git Fix: bashate E010 warnings E010 rule ensures consistency of "do" directive being on the same line as it's command. Signed-off-by: Guillaume Lambert Change-Id: Id7717658728968da017107c4b496cdfbe0c5b6b0 --- diff --git a/shell/deploy-maven-file.sh b/shell/deploy-maven-file.sh index e5bf0500..9721ee22 100644 --- a/shell/deploy-maven-file.sh +++ b/shell/deploy-maven-file.sh @@ -37,8 +37,7 @@ export MAVEN_PARAMS DEPLOY_LOG="$WORKSPACE/archives/deploy-maven-file.log" mkdir -p "$WORKSPACE/archives" -while IFS="" read -r file -do +while IFS="" read -r file; do file_size=$(stat --printf="%s" "${file}") echo "Deploy ${file##*/} with ${file_size} bytes." lftools deploy maven-file "$MAVEN_REPO_URL" \ diff --git a/shell/docker-login.sh b/shell/docker-login.sh index 72d420f3..751ac20b 100644 --- a/shell/docker-login.sh +++ b/shell/docker-login.sh @@ -94,8 +94,7 @@ do_login() { # Loop through Registry and Ports to concatentate and login to nexus if [ "${DOCKER_REGISTRY:-none}" != 'none' ] then - for PORT in $REGISTRY_PORTS - do + for PORT in $REGISTRY_PORTS; do REGISTRY="${DOCKER_REGISTRY}:${PORT}" # docker login requests an email address if nothing is passed to it diff --git a/shell/jjb-verify-build-nodes.sh b/shell/jjb-verify-build-nodes.sh index b4457e42..93d85be8 100644 --- a/shell/jjb-verify-build-nodes.sh +++ b/shell/jjb-verify-build-nodes.sh @@ -44,7 +44,9 @@ isBadLabel () { isValueInArray () { local e match="$1" shift - for e; do [[ "$e" == "$match" ]] && return 0; done + for e; do + [[ "$e" == "$match" ]] && return 0 + done return 1 } diff --git a/shell/openstack-kubernetes-create.sh b/shell/openstack-kubernetes-create.sh index 5ee05b09..e94dc948 100755 --- a/shell/openstack-kubernetes-create.sh +++ b/shell/openstack-kubernetes-create.sh @@ -59,8 +59,7 @@ cluster_uuid=$(openstack coe cluster create "$cluster_name" \ # Sleep for a little, because sometimes OpenStack has to catch up with itself sleep 15 -while [ "$(openstack --os-cloud "$os_cloud" coe cluster show "$cluster_uuid" -c status -f value)" == "CREATE_IN_PROGRESS" ] -do +while [ "$(openstack --os-cloud "$os_cloud" coe cluster show "$cluster_uuid" -c status -f value)" == "CREATE_IN_PROGRESS" ]; do # echo "sleeping $(date)" sleep 2m done diff --git a/shell/pipeline-linter.sh b/shell/pipeline-linter.sh index 8ed681d5..fad1f72c 100644 --- a/shell/pipeline-linter.sh +++ b/shell/pipeline-linter.sh @@ -18,8 +18,7 @@ JENKINS_VAL="$JENKINS_URL/pipeline-model-converter/validate" mapfile -t JENKINS_FILE_LIST < <(grep -lr "^pipeline\s*{" vars src Jenkinsfile*) exit_code=0 -for JENKINS_FILE in "${JENKINS_FILE_LIST[@]}" -do +for JENKINS_FILE in "${JENKINS_FILE_LIST[@]}"; do ret=$(curl --silent -X POST -H "$JENKINS_CRUMB" -F "jenkinsfile=<$JENKINS_FILE" "$JENKINS_VAL") if [[ $ret == *"Errors"* ]];then echo "ERROR: Linting error for $JENKINS_FILE" diff --git a/shell/sysstat.sh b/shell/sysstat.sh index 5b496259..e071ad1a 100644 --- a/shell/sysstat.sh +++ b/shell/sysstat.sh @@ -47,8 +47,7 @@ SAR_DIR="$WORKSPACE/archives/sar-reports" mkdir -p "$SAR_DIR" cp "$SYSSTAT_PATH/"* "$_" # convert sar data to ascii format -while IFS="" read -r sarfilenum -do +while IFS="" read -r sarfilenum; do [ -f "$sarfilenum" ] && LC_TIME=POSIX sar -A -f "$sarfilenum" > "$SAR_DIR/sar${sarfilenum//[!0-9]/}" done < <(find "$SYSSTAT_PATH" -name "sa[0-9]*" || true)