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 <agardner@linuxfoundation.org>
Change-Id: Ib5610d6110e762f4510e62794215d17a086a1d20
--- /dev/null
+---
+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.
# 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
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" \
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"