From c88571bf98fdabf12a2b5d0e8cafc88e7229ab9d Mon Sep 17 00:00:00 2001 From: Tianhao He Date: Mon, 30 Nov 2015 14:14:11 -0800 Subject: [PATCH 1/2] pass unverified sslcontext to bay pass server certificate verification --- sample/getallvms.py | 14 ++++++-------- sample/poweronvm.py | 6 +++++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sample/getallvms.py b/sample/getallvms.py index 61def9c71..78f0edf3e 100755 --- a/sample/getallvms.py +++ b/sample/getallvms.py @@ -20,18 +20,12 @@ from __future__ import print_function -import pyVmomi - -from pyVmomi import vim -from pyVmomi import vmodl - from pyVim.connect import SmartConnect, Disconnect -from pyVmomi import vmodl import argparse import atexit import getpass - +import ssl def GetArgs(): """ @@ -96,10 +90,14 @@ def main(): password = getpass.getpass(prompt='Enter password for host %s and ' 'user %s: ' % (args.host,args.user)) + + context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) + context.verify_mode = ssl.CERT_NONE si = SmartConnect(host=args.host, user=args.user, pwd=password, - port=int(args.port)) + port=int(args.port), + sslContext=context) if not si: print("Could not connect to the specified host using specified " "username and password") diff --git a/sample/poweronvm.py b/sample/poweronvm.py index b834a1942..9ab4c8962 100755 --- a/sample/poweronvm.py +++ b/sample/poweronvm.py @@ -28,6 +28,7 @@ import atexit import getpass import sys +import ssl def GetArgs(): """ @@ -113,11 +114,14 @@ def main(): sys.exit() si = None + context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) + context.verify_mode = ssl.CERT_NONE try: si = SmartConnect(host=args.host, user=args.user, pwd=password, - port=int(args.port)) + port=int(args.port), + sslContext=context) except IOError: pass if not si: From 3fefedd61055f4d6b8741029f0e4f2ff098af319 Mon Sep 17 00:00:00 2001 From: Tianhao He Date: Mon, 30 Nov 2015 14:14:54 -0800 Subject: [PATCH 2/2] update doc for vsphere 6.0.0 release --- README.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 9e366b03f..0d1cf1871 100644 --- a/README.rst +++ b/README.rst @@ -48,11 +48,12 @@ Documentation ============= For general language neutral documentation of vSphere Management API see: -* `vSphere WS SDK API Docs `_ +* `vSphere WS SDK API Docs `_ Python Support ============== -* pyVmomi 5.5.0-2014.1 and later support Python 2.6, 2.7, 3.3 and 3.4 +* pyVmomi 6.0.0 and later support 2.7, 3.3 and 3.4 +* pyVmomi 5.5.0-2014.1 and 5.5.0-2014.1.1 support Python 2.6, 2.7, 3.3 and 3.4 * pyVmomi 5.5.0 and below support Python 2.6 and 2.7 Compatibility Policy @@ -62,14 +63,15 @@ backward compatibility with the previous _four_ releases of *vSphere* and it's own previous four releases. Compatibility with much older versions may continue to work but will not be actively supported. -For example, version v5.5.0-2014.1 is most compatible with vSphere 5.5, 5.1, -5.0, and 4.1 and was the first release in 2014. Initial releases compatible with -a version of vSphere will bare a naked version number of v5.5.0 indicating that -version of pyVmomi was released simultaneously with the *GA* version of vSphere -with the same version number. +For example, version v6.0.0 is most compatible with vSphere 6.0, 5.5, 5.1 and +5.0. Initial releases compatible with a version of vSphere will bare a naked +version number of v6.0.0 indicating that version of pyVmomi was released +simultaneously with the *GA* version of vSphere with the same version number. Releases ======== +* `6.0.0 `_ + release notes https://github.com/vmware/pyvmomi/releases/tag/v6.0.0 * `5.5.0-2014.1.1 `_ release notes https://github.com/vmware/pyvmomi/releases/tag/v5.5.0-2014.1.1 * `5.5.0-2014.1 `_