properly fail_json when we don't have ssl on a non-redhat distro

pull/4420/head
Toshio Kuratomi 2015-10-16 08:05:57 -07:00
parent 4b4168bc92
commit 28c933ce5e
1 changed files with 2 additions and 0 deletions

View File

@ -764,6 +764,8 @@ def fetch_url(module, url, data=None, headers=None, method=None,
distribution = get_distribution()
if distribution.lower() == 'redhat':
module.fail_json(msg='%s. You can also install python-ssl from EPEL' % str(e))
else:
module.fail_json(msg='%s' % str(e))
except (ConnectionError, ValueError), e:
module.fail_json(msg=str(e))
except urllib2.HTTPError, e: