From e89478b17cdf59665e3915390973f93cafcab024 Mon Sep 17 00:00:00 2001 From: Aric Gardner Date: Mon, 20 Jul 2020 13:11:41 -0400 Subject: [PATCH] lftools_activate should be deprecated We have lf-env.sh and lf-activate-venv on all builders. It is a more error resitant way to make sure a pip package is installed In tests lf-env passes in places that lftools_activate fails. Issue-ID: IT-20217 Signed-off-by: Aric Gardner Change-Id: Ib5610d6110e762f4510e62794215d17a086a1d20 --- releasenotes/notes/maven-deploy-87ad380c53d8e2c2.yaml | 19 +++++++++++++++++++ shell/common-variables.sh | 1 + shell/maven-deploy.sh | 7 +++++-- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/maven-deploy-87ad380c53d8e2c2.yaml diff --git a/releasenotes/notes/maven-deploy-87ad380c53d8e2c2.yaml b/releasenotes/notes/maven-deploy-87ad380c53d8e2c2.yaml new file mode 100644 index 00000000..e6167196 --- /dev/null +++ b/releasenotes/notes/maven-deploy-87ad380c53d8e2c2.yaml @@ -0,0 +1,19 @@ +--- +fixes: + - | + Resolves the lftools_activate failure below. + + .. code-block:: bash + + ---> maven-deploy.sh + ImportError: cannot import name 'enquote_executable' + + Fix is to replace lftools_activate with lf-activate-venv + by sourcing lf-env.sh + lf-activate-venv is a more error resistant way to make sure a pip + package is installed + +deprecates: + - | + lftools_activate should no longer be used and will be removed + in a future release. diff --git a/shell/common-variables.sh b/shell/common-variables.sh index 346eb727..5092a8ea 100644 --- a/shell/common-variables.sh +++ b/shell/common-variables.sh @@ -23,6 +23,7 @@ echo "$MAVEN_OPTIONS" # Activates the lftools virtualenv lftools_activate() { + echo "WARNING: lftools_activate should no longer be used and will be removed in a future release." virtualenv --quiet "/tmp/v/lftools" set +u # Ignore unbound variables in activate # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091 diff --git a/shell/maven-deploy.sh b/shell/maven-deploy.sh index 38c2f7dd..f9e28893 100644 --- a/shell/maven-deploy.sh +++ b/shell/maven-deploy.sh @@ -21,8 +21,6 @@ set -eu -o pipefail m2repo_dir="$WORKSPACE/m2repo" nexus_repo_url="$NEXUS_URL/content/repositories/$NEXUS_REPO" -lftools_activate - echo "-----> Remove metadata files that were not updated" set +e # Temporarily disable to run diff command. mapfile -t metadata_files <<< "$(diff -s -r "$m2repo_dir" "$WORKSPACE/m2repo-backup" \ @@ -41,5 +39,10 @@ set -u # Re-enable. find "$m2repo_dir" -type d -empty -delete +echo "-----> Install lftools" +# shellcheck disable=SC1090 +source ~/lf-env.sh +lf-activate-venv lftools + echo "-----> Upload files to Nexus" lftools deploy nexus -s "$nexus_repo_url" "$m2repo_dir" -- 2.16.6