summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2015-07-24 15:07:02 -0700
committerToshio Kuratomi <toshio@fedoraproject.org>2015-07-24 15:08:38 -0700
commit2afb7f717d3ac3cee85e2ecb80e1ff08217a310c (patch)
treeb77c0163d32df107b986bd3e1bcd318f304133f6
parentf074c6ad353805a6c8c98bac4b2f3f34e7742443 (diff)
downloadansible-2afb7f717d3ac3cee85e2ecb80e1ff08217a310c.tar.gz
Guard the PROTOCOL setting so that we work on older pythons
-rw-r--r--lib/ansible/module_utils/urls.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ansible/module_utils/urls.py b/lib/ansible/module_utils/urls.py
index a7d58fdf38..9c5fdd7f57 100644
--- a/lib/ansible/module_utils/urls.py
+++ b/lib/ansible/module_utils/urls.py
@@ -109,8 +109,9 @@ except ImportError:
# Select a protocol that includes all secure tls protocols
# Exclude insecure ssl protocols if possible
-# If we can't find extra tls methods, ssl.PROTOCOL_TLSv1 is sufficient
-PROTOCOL = ssl.PROTOCOL_TLSv1
+if HAS_SSL:
+ # If we can't find extra tls methods, ssl.PROTOCOL_TLSv1 is sufficient
+ PROTOCOL = ssl.PROTOCOL_TLSv1
if not HAS_SSLCONTEXT and HAS_SSL:
try:
import ctypes, ctypes.util