]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
use mktemp when creating the venv directory 422/head
authorAndrew Schoen <aschoen@redhat.com>
Thu, 4 Aug 2016 18:30:47 +0000 (13:30 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Thu, 4 Aug 2016 18:38:10 +0000 (13:38 -0500)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
scripts/build_utils.sh

index 4521c369cf0a3e5a56c2e654e33a98819d5c3f3f..5f1a67aa72e820cb1d5fbeb739fe0fb3b88b6348 100644 (file)
@@ -2,7 +2,8 @@
 
 set -ex
 
-VENV="/tmp/jenkins-venv/bin"
+TEMPVENV=$(mktemp -td venv.XXXXXXXXXX)
+VENV="$TEMPVENV/bin"
 
 install_python_packages () {
     # Use this function to create a virtualenv and install
@@ -14,8 +15,7 @@ install_python_packages () {
     #   install_python_packages "to_install[@]"
 
     # Create the virtualenv
-    rm -rf "/tmp/jenkins-venv"
-    virtualenv /tmp/jenkins-venv
+    virtualenv $TEMPVENV
 
     # Define and ensure the PIP cache
     PIP_SDIST_INDEX="$HOME/.cache/pip"