From 8ee3b7384da14724da240ddc347388e361c35e87 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Fri, 24 Jul 2015 15:07:02 -0700 Subject: [PATCH] Guard the PROTOCOL setting so that we work on older pythons --- lib/ansible/module_utils/urls.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/urls.py b/lib/ansible/module_utils/urls.py index 6530ba81e81..86e92183ca1 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