From 5751c3a9e65bae6a4894b74505f5104953d8b435 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Thu, 31 Oct 2013 12:59:30 -0400 Subject: [PATCH] Update devstack-cache.py to install RPMs. Change-Id: I952c0b474218552a98ad3f499fc0e7f3eba67e23 --- .../files/nodepool/scripts/devstack-cache.py | 25 ++++++++++++++----- 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/modules/openstack_project/files/nodepool/scripts/devstack-cache.py b/modules/openstack_project/files/nodepool/scripts/devstack-cache.py index 308749094a..9497c1ec91 100755 --- a/modules/openstack_project/files/nodepool/scripts/devstack-cache.py +++ b/modules/openstack_project/files/nodepool/scripts/devstack-cache.py @@ -73,12 +73,21 @@ def local_prep(distribution): run_local(['git', 'checkout', branch], cwd=DEVSTACK) run_local(['git', 'pull', '--ff-only', 'origin'], cwd=DEVSTACK) - debs = [] - debdir = os.path.join(DEVSTACK, 'files', 'apts') - for fn in os.listdir(debdir): - fn = os.path.join(debdir, fn) - tokenize(fn, debs, distribution, comment='#') - branch_data['debs'] = debs + if os.path.exists('/usr/bin/apt-get'): + debs = [] + debdir = os.path.join(DEVSTACK, 'files', 'apts') + for fn in os.listdir(debdir): + fn = os.path.join(debdir, fn) + tokenize(fn, debs, distribution, comment='#') + branch_data['debs'] = debs + + if os.path.exists('/usr/bin/rpm'): + rpms = [] + rpmdir = os.path.join(DEVSTACK, 'files', 'rpms') + for fn in os.listdir(rpmdir): + fn = os.path.join(rpmdir, fn) + tokenize(fn, rpms, distribution, comment='#') + branch_data['rpms'] = rpms images = [] for line in open(os.path.join(DEVSTACK, 'stackrc')): @@ -111,6 +120,10 @@ def main(): run_local(['sudo', 'apt-get', '-y', '-d', 'install'] + branch_data['debs']) + if branch_data['rpms']: + run_local(['sudo', 'yum', 'install', '-y', '--downloadonly'] + + branch_data['rpms']) + for url in branch_data['images']: fname = url.split('/')[-1] if fname in image_filenames: