Merge "lftools_activate should be deprecated" v0.55.2
authorJessica Wagantall <jwagantall@linuxfoundation.org>
Mon, 20 Jul 2020 21:14:02 +0000 (21:14 +0000)
committerGerrit Code Review <gerrit@linuxfoundation.org>
Mon, 20 Jul 2020 21:14:02 +0000 (21:14 +0000)
releasenotes/notes/maven-deploy-87ad380c53d8e2c2.yaml [new file with mode: 0644]
shell/common-variables.sh
shell/maven-deploy.sh

diff --git a/releasenotes/notes/maven-deploy-87ad380c53d8e2c2.yaml b/releasenotes/notes/maven-deploy-87ad380c53d8e2c2.yaml
new file mode 100644 (file)
index 0000000..e616719
--- /dev/null
@@ -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.
index 346eb72..5092a8e 100644 (file)
@@ -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
index 38c2f7d..f9e2889 100644 (file)
@@ -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"