summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhijeet Kasurde <akasurde@redhat.com>2018-03-09 04:51:09 +0530
committerMatt Davis <nitzmahone@users.noreply.github.com>2018-03-08 15:21:09 -0800
commit05b3b731854646a8375c9fb96da817a64a5c9576 (patch)
treed09259713e7cf3c64a0d1196d025db3a232ca68a
parent1842e34a738a2c4df6a3e6220b8720885c9cd10f (diff)
downloadansible-05b3b731854646a8375c9fb96da817a64a5c9576.tar.gz
Fixes commit a28eb94, which broke validate_certs = False for python < 2.7.9 (#34887) (#37018)
(cherry picked from commit ce416f247f0737b4d7d63ca6ec471d0130446cee)
-rw-r--r--lib/ansible/modules/cloud/vmware/_vsphere_guest.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ansible/modules/cloud/vmware/_vsphere_guest.py b/lib/ansible/modules/cloud/vmware/_vsphere_guest.py
index 8e4a2f3485..ccf43758e2 100644
--- a/lib/ansible/modules/cloud/vmware/_vsphere_guest.py
+++ b/lib/ansible/modules/cloud/vmware/_vsphere_guest.py
@@ -1803,7 +1803,7 @@ def main():
module.fail_json(msg='pysphere does not support verifying certificates with python < 2.7.9. Either update python or set '
'validate_certs=False on the task')
- if not validate_certs:
+ if not validate_certs and hasattr(ssl, 'SSLContext'):
ssl._create_default_https_context = ssl._create_unverified_context
try: