X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fcheck-info-votes.sh;h=32384be4ddcea18548ca8532b52973257688d1a8;hb=c8b9acd166fcbd88139a65f7721e522980a0e013;hp=1e02a386edfe4c026244cac700f76c83a58844b2;hpb=12853a424496b5d87c355f32fa27604099a0edbb;p=releng%2Fglobal-jjb.git diff --git a/shell/check-info-votes.sh b/shell/check-info-votes.sh index 1e02a386..32384be4 100644 --- a/shell/check-info-votes.sh +++ b/shell/check-info-votes.sh @@ -16,17 +16,24 @@ pip="pip3" # For OPNFV if [[ $NODE_NAME =~ "lf-build" ]]; then - pip=pip + pip=pip fi if [ -d "/opt/pyenv" ]; then - echo "---> Setting up pyenv" - export PYENV_ROOT="/opt/pyenv" - export PATH="$PYENV_ROOT/bin:$PATH" - PYTHONPATH=$(pwd) - export PYTHONPATH - pyenv local 3.6.4 - export PYENV_VERSION="3.6.4" + echo "---> Setting up pyenv" + export PYENV_ROOT="/opt/pyenv" + export PATH="$PYENV_ROOT/bin:$PATH" + PYTHONPATH=$(pwd) + export PYTHONPATH + + latest_version=$(pyenv versions \ + | sed s,*,,g \ + | awk '/[0-9]+/{ print $1 }' \ + | sort --version-sort \ + | awk '/./{line=$0} END{print line}') + + pyenv local "$latest_version" + export PYENV_VERSION="3.6.4" fi $pip install --user niet @@ -39,12 +46,12 @@ lftools infofile check-votes INFO.yaml "$GERRIT_URL" "$ref" > gerrit_comment.txt exit_status="$?" if [[ "$exit_status" -ne 0 ]]; then - echo "Vote not yet complete" - cat gerrit_comment.txt - exit "$exit_status" + echo "Vote not yet complete" + cat gerrit_comment.txt + exit "$exit_status" else - echo "Vote completed submitting review" - ssh -p "$GERRIT_PORT" "$USER"@"$GERRIT_HOST" gerrit review "$GERRIT_PATCHSET_REVISION" --verified 1 - sleep 5 - ssh -p "$GERRIT_PORT" "$USER"@"$GERRIT_HOST" gerrit review "$GERRIT_PATCHSET_REVISION" --submit + echo "Vote completed submitting review" + ssh -p "$GERRIT_PORT" "$USER"@"$GERRIT_HOST" gerrit review "$GERRIT_PATCHSET_REVISION" --verified 1 + sleep 5 + ssh -p "$GERRIT_PORT" "$USER"@"$GERRIT_HOST" gerrit review "$GERRIT_PATCHSET_REVISION" --submit fi