]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
build_utils: use virtualenv -p python2.7 instead virtualenv 1361/head
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 12 Aug 2019 21:00:11 +0000 (23:00 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Wed, 14 Aug 2019 18:15:55 +0000 (20:15 +0200)
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
scripts/build_utils.sh

index 76b2f3cfb3ba28ac81db8ae4cbd3050fc48c3972..689cd437c42e7aa99c094e76fa2432dd3d7a1918 100644 (file)
@@ -85,6 +85,15 @@ pip_download() {
     fi
 }
 
+create_virtualenv () {
+    local path=$1
+    if [ "$(ls -A $path)" ]; then
+        echo "Will reuse existing virtual env: $path"
+    else
+        virtualenv -p python2.7 $path
+    fi
+}
+
 install_python_packages_no_binary () {
     # Use this function to create a virtualenv and install python packages
     # without compiling (or using wheels). Pass a list of package names.  If
@@ -96,13 +105,7 @@ install_python_packages_no_binary () {
     #   to_install=( "ansible" "chacractl>=0.0.4" )
     #   install_python_packages_no_binary "to_install[@]"
 
-    # Create the virtualenv
-    if [ "$(ls -A $TEMPVENV)" ]; then
-        echo "Will reuse existing virtual env: $TEMPVENV"
-    else
-        virtualenv $TEMPVENV
-    fi
-
+    create_virtualenv $TEMPVENV
 
     # Define and ensure the PIP cache
     PIP_SDIST_INDEX="$HOME/.cache/pip"
@@ -141,8 +144,7 @@ install_python_packages () {
     #   to_install=( "ansible" "chacractl>=0.0.4" )
     #   install_python_packages "to_install[@]"
 
-    # Create the virtualenv
-    virtualenv $TEMPVENV
+    create_virtualenv $TEMPVENV
 
     # Define and ensure the PIP cache
     PIP_SDIST_INDEX="$HOME/.cache/pip"