]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Worker shouldn't attempt to rebuild an existing virtualenv 47/head
authorZack Cerza <zack@cerza.org>
Thu, 22 Aug 2013 23:02:22 +0000 (18:02 -0500)
committerZack Cerza <zack@cerza.org>
Thu, 22 Aug 2013 23:02:22 +0000 (18:02 -0500)
bootstrap
teuthology/queue.py

index 695180621706c3a5733c393f11e64eb10c941669..d03ad66619e536037a0f6896f53ff1e4bd13199f 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -13,12 +13,14 @@ if [ -n "$missing" ]; then
     exit 1
 fi
 
-# site packages needed because libvirt python bindings are not nicely
-# packaged
-virtualenv --system-site-packages --distribute virtualenv
+if [ -z "$NO_CLOBBER" ] || [ ! -e ./virtualenv ]; then
+    # site packages needed because libvirt python bindings are not nicely
+    # packaged
+    virtualenv --system-site-packages --distribute virtualenv
 
-# avoid pip bugs
-./virtualenv/bin/pip install --upgrade pip
+    # avoid pip bugs
+    ./virtualenv/bin/pip install --upgrade pip
+fi
 
 ./virtualenv/bin/pip install -r requirements.txt
 
index cdd52960ca449b91b5bb7f82e9641fc57c2a19e0..1f3606ccf22ffcc2561ab205b8df23fe908b892f 100644 (file)
@@ -104,7 +104,11 @@ describe. One job is run at a time.
             subprocess.Popen(('git', 'reset', '--hard', 'origin/%s' %
                               teuthology_branch), cwd=teuth_path)
         log.info("Bootstrapping %s", teuth_path)
-        subprocess.Popen(('./bootstrap'), cwd=teuth_path)
+        # This magic makes the bootstrap script not attempt to clobber an
+        # existing virtualenv.
+        env = os.environ.copy()
+        env['NO_CLOBBER'] = '1'
+        subprocess.Popen(('./bootstrap'), cwd=teuth_path, env)
         teuth_bin_path = os.path.join(teuth_path, 'virtualenv', 'bin')
         if not os.path.isdir(teuth_bin_path):
             raise RuntimeError('Teuthology branch %s not found at %s' %