From ce416f247f0737b4d7d63ca6ec471d0130446cee Mon Sep 17 00:00:00 2001 From: Mike Klebolt Date: Mon, 5 Mar 2018 10:34:03 -0600 Subject: [PATCH] Fixes commit a28eb94, which broke validate_certs = False for python < 2.7.9 (#34887) --- lib/ansible/modules/cloud/vmware/_vsphere_guest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/vmware/_vsphere_guest.py b/lib/ansible/modules/cloud/vmware/_vsphere_guest.py index 7093964fd0..6109ab150d 100644 --- a/lib/ansible/modules/cloud/vmware/_vsphere_guest.py +++ b/lib/ansible/modules/cloud/vmware/_vsphere_guest.py @@ -1808,7 +1808,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: