mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add has_sslcontext fact as well
This commit is contained in:
parent
7158eb489f
commit
d9a207f24f
1 changed files with 11 additions and 1 deletions
|
@ -44,6 +44,15 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
HAVE_SELINUX=False
|
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:
|
try:
|
||||||
import json
|
import json
|
||||||
# Detect python-json which is incompatible and fallback to simplejson in
|
# Detect python-json which is incompatible and fallback to simplejson in
|
||||||
|
@ -794,7 +803,8 @@ class Facts(object):
|
||||||
},
|
},
|
||||||
'version_info': list(sys.version_info),
|
'version_info': list(sys.version_info),
|
||||||
'executable': sys.executable,
|
'executable': sys.executable,
|
||||||
'type': sys.subversion[0]
|
'type': sys.subversion[0],
|
||||||
|
'has_sslcontext': HAS_SSLCONTEXT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue