From 931a7133503832702f614cb3427226ef35418301 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Sat, 5 Nov 2016 22:00:06 -0500 Subject: If fetch_url failed to download the URL fail early with a proper error message. Fixes #5474 (#5476) --- packaging/os/yum.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packaging/os/yum.py b/packaging/os/yum.py index 131144d8..be5e1676 100644 --- a/packaging/os/yum.py +++ b/packaging/os/yum.py @@ -225,6 +225,8 @@ def fetch_rpm_from_url(spec, module=None): package = os.path.join(tempdir, str(spec.rsplit('/', 1)[1])) try: rsp, info = fetch_url(module, spec) + if not rsp: + module.fail_json(msg="Failure downloading %s, %s" % (spec, info['msg'])) f = open(package, 'w') data = rsp.read(BUFSIZE) while data: -- cgit v1.2.1