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
This commit is contained in:
parent
e7260de708
commit
a8e703d73e
@ -21,6 +21,7 @@ import sys
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
DEVSTACK=os.path.expanduser('~/workspace-cache/devstack')
|
DEVSTACK=os.path.expanduser('~/workspace-cache/devstack')
|
||||||
|
CACHEDIR=os.path.expanduser('~/cache/files')
|
||||||
|
|
||||||
def run_local(cmd, status=False, cwd='.', env={}):
|
def run_local(cmd, status=False, cwd='.', env={}):
|
||||||
print "Running:", cmd
|
print "Running:", cmd
|
||||||
@ -115,7 +116,7 @@ def main():
|
|||||||
if fname in image_filenames:
|
if fname in image_filenames:
|
||||||
continue
|
continue
|
||||||
run_local(['wget', '-nv', '-c', url,
|
run_local(['wget', '-nv', '-c', url,
|
||||||
'-O', '~/cache/files/%s' % fname])
|
'-O', os.path.join(CACHEDIR, fname)])
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user