From a8e703d73e121d7bd34b70c227c5fcd3d5467fd9 Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Sun, 20 Oct 2013 01:41:02 +0000 Subject: [PATCH] Expand user when caching files for devstack * modules/openstack_project/files/nodepool/scripts/devstack-cache.py: Since subprocess.Popen doesn't expand user when the default shell=False is in effect, make a separate os.path.expanduser call to resolve the destination path for caching downloads. Change-Id: Ia0024d03ea23f201f6e88ba14ff6b478f32c0684 --- .../openstack_project/files/nodepool/scripts/devstack-cache.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/openstack_project/files/nodepool/scripts/devstack-cache.py b/modules/openstack_project/files/nodepool/scripts/devstack-cache.py index 1aefe09427..308749094a 100755 --- a/modules/openstack_project/files/nodepool/scripts/devstack-cache.py +++ b/modules/openstack_project/files/nodepool/scripts/devstack-cache.py @@ -21,6 +21,7 @@ import sys import subprocess DEVSTACK=os.path.expanduser('~/workspace-cache/devstack') +CACHEDIR=os.path.expanduser('~/cache/files') def run_local(cmd, status=False, cwd='.', env={}): print "Running:", cmd @@ -115,7 +116,7 @@ def main(): if fname in image_filenames: continue run_local(['wget', '-nv', '-c', url, - '-O', '~/cache/files/%s' % fname]) + '-O', os.path.join(CACHEDIR, fname)]) if __name__ == '__main__': main()