If fetch_url failed to download the URL fail early with a proper error message. Fixes #5474 (#5476)

pull/18777/head
Matt Martz 8 years ago committed by Matt Clay
parent 352d280058
commit 08ce50c2b3

@ -225,6 +225,8 @@ def fetch_rpm_from_url(spec, module=None):
package = os.path.join(tempdir, str(spec.rsplit('/', 1)[1])) package = os.path.join(tempdir, str(spec.rsplit('/', 1)[1]))
try: try:
rsp, info = fetch_url(module, spec) rsp, info = fetch_url(module, spec)
if not rsp:
module.fail_json(msg="Failure downloading %s, %s" % (spec, info['msg']))
f = open(package, 'w') f = open(package, 'w')
data = rsp.read(BUFSIZE) data = rsp.read(BUFSIZE)
while data: while data:

Loading…
Cancel
Save