Added --fail argument to curl invocations, so that HTTP request fails get surfaced as non-zero exit codes
This commit is contained in:
@@ -59,21 +59,21 @@ def download(img):
|
|||||||
for f in img['files']:
|
for f in img['files']:
|
||||||
if f['kind'] == 'kernel':
|
if f['kind'] == 'kernel':
|
||||||
dest = os.path.join(tempdir, 'kernel')
|
dest = os.path.join(tempdir, 'kernel')
|
||||||
subprocess.call(['curl', f['url'], '-o', dest])
|
subprocess.call(['curl', '--fail', f['url'], '-o', dest])
|
||||||
kernel_id = image.Image.add(dest,
|
kernel_id = image.Image.add(dest,
|
||||||
description='kernel/' + img['title'], kernel=True)
|
description='kernel/' + img['title'], kernel=True)
|
||||||
|
|
||||||
for f in img['files']:
|
for f in img['files']:
|
||||||
if f['kind'] == 'ramdisk':
|
if f['kind'] == 'ramdisk':
|
||||||
dest = os.path.join(tempdir, 'ramdisk')
|
dest = os.path.join(tempdir, 'ramdisk')
|
||||||
subprocess.call(['curl', f['url'], '-o', dest])
|
subprocess.call(['curl', '--fail', f['url'], '-o', dest])
|
||||||
ramdisk_id = image.Image.add(dest,
|
ramdisk_id = image.Image.add(dest,
|
||||||
description='ramdisk/' + img['title'], ramdisk=True)
|
description='ramdisk/' + img['title'], ramdisk=True)
|
||||||
|
|
||||||
for f in img['files']:
|
for f in img['files']:
|
||||||
if f['kind'] == 'image':
|
if f['kind'] == 'image':
|
||||||
dest = os.path.join(tempdir, 'image')
|
dest = os.path.join(tempdir, 'image')
|
||||||
subprocess.call(['curl', f['url'], '-o', dest])
|
subprocess.call(['curl', '--fail', f['url'], '-o', dest])
|
||||||
ramdisk_id = image.Image.add(dest,
|
ramdisk_id = image.Image.add(dest,
|
||||||
description=img['title'], kernel=kernel_id, ramdisk=ramdisk_id)
|
description=img['title'], kernel=kernel_id, ramdisk=ramdisk_id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user