From 353b549eb046048b06dd8920b15468416ecbb17f Mon Sep 17 00:00:00 2001 From: Jesper Geertsen Jonsson Date: Sun, 27 Sep 2015 18:01:19 +0000 Subject: [PATCH] Fix HTTPError message not being reachable --- lib/ansible/plugins/lookup/url.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/plugins/lookup/url.py b/lib/ansible/plugins/lookup/url.py index a893493db4..51ab0303dc 100644 --- a/lib/ansible/plugins/lookup/url.py +++ b/lib/ansible/plugins/lookup/url.py @@ -36,10 +36,10 @@ class LookupModule(LookupBase): self._display.vvvv("url lookup connecting to %s" % term) try: response = open_url(term, validate_certs=validate_certs) - except urllib2.URLError as e: - raise AnsibleError("Failed lookup url for %s : %s" % (term, str(e))) except urllib2.HTTPError as e: raise AnsibleError("Received HTTP error for %s : %s" % (term, str(e))) + except urllib2.URLError as e: + raise AnsibleError("Failed lookup url for %s : %s" % (term, str(e))) except SSLValidationError as e: raise AnsibleError("Error validating the server's certificate for %s: %s" % (term, str(e))) except ConnectionError as e: