From a9df6c2a6aca091ce17efe556e1264000cafe6ae Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Thu, 22 Aug 2013 18:02:22 -0500 Subject: [PATCH] Worker shouldn't attempt to rebuild an existing virtualenv --- bootstrap | 12 +++++++----- teuthology/queue.py | 6 +++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/bootstrap b/bootstrap index 695180621706c..d03ad66619e53 100755 --- 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 diff --git a/teuthology/queue.py b/teuthology/queue.py index cdd52960ca449..1f3606ccf22ff 100644 --- a/teuthology/queue.py +++ b/teuthology/queue.py @@ -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' % -- 2.39.5