From 6894c3ffaac30a3f14ee9b3dfe48d960ddbffe0a Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 12 Mar 2014 15:41:43 -0700 Subject: [PATCH] Download each cached image once. Nodepool's devstack image cacher was redownloading every image one time per devstack branch. We only need to download the image once if the image name doesn't change. Change-Id: Ib1910c34b8479ebad740a915fcc9297205cbe387 --- .../openstack_project/files/nodepool/scripts/cache_devstack.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openstack_project/files/nodepool/scripts/cache_devstack.py b/modules/openstack_project/files/nodepool/scripts/cache_devstack.py index 9767c3aa84..416c68c8a7 100755 --- a/modules/openstack_project/files/nodepool/scripts/cache_devstack.py +++ b/modules/openstack_project/files/nodepool/scripts/cache_devstack.py @@ -106,7 +106,7 @@ def main(): distribution = sys.argv[1] branches = local_prep(distribution) - image_filenames = {} + image_filenames = [] for branch_data in branches: if branch_data.get('debs'): run_local(['sudo', 'apt-get', '-y', '-d', 'install'] + @@ -121,6 +121,7 @@ def main(): fname = url.split('/')[-1] if fname in image_filenames: continue + image_filenames.append(fname) run_local(['wget', '-nv', '-c', url, '-O', os.path.join(CACHEDIR, fname)])