apt_key clear message when downloading key returns an (http) error code
This commit is contained in:
parent
c61d04dd1f
commit
e12d09861f
1 changed files with 4 additions and 0 deletions
|
@ -153,8 +153,12 @@ def download_key(module, url):
|
||||||
# and reuse here
|
# and reuse here
|
||||||
if url is None:
|
if url is None:
|
||||||
module.fail_json(msg="needed a URL but was not specified")
|
module.fail_json(msg="needed a URL but was not specified")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rsp, info = fetch_url(module, url)
|
rsp, info = fetch_url(module, url)
|
||||||
|
if info['status'] != 200:
|
||||||
|
module.fail_json(msg="Failed to download key at %s: %s" % (url, info['msg']))
|
||||||
|
|
||||||
return rsp.read()
|
return rsp.read()
|
||||||
except Exception:
|
except Exception:
|
||||||
module.fail_json(msg="error getting key id from url: %s" % url, traceback=format_exc())
|
module.fail_json(msg="error getting key id from url: %s" % url, traceback=format_exc())
|
||||||
|
|
Loading…
Reference in a new issue