From d9a207f24f46d76c3b05650b3e908c161786a2b9 Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Tue, 23 Feb 2016 11:28:04 -0600 Subject: [PATCH] Add has_sslcontext fact as well --- lib/ansible/module_utils/facts.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 53c4133575..e698d780ff 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -44,6 +44,15 @@ try: except ImportError: HAVE_SELINUX=False +try: + # Check if we have SSLContext support + from ssl import create_default_context, SSLContext + del create_default_context + del SSLContext + HAS_SSLCONTEXT = True +except ImportError: + HAS_SSLCONTEXT = False + try: import json # Detect python-json which is incompatible and fallback to simplejson in @@ -794,7 +803,8 @@ class Facts(object): }, 'version_info': list(sys.version_info), 'executable': sys.executable, - 'type': sys.subversion[0] + 'type': sys.subversion[0], + 'has_sslcontext': HAS_SSLCONTEXT }