I am writing scripts in Python2.6 with use of pyVmomi and while using one of the connection methods:
service_instance = connect.SmartConnect(host=args.ip,
Why not using pyvmomi original function SmartConnectNoSSL.
They added this function on June 14, 2016 and named it ConnectNoSSL, one day after they changed the name to SmartConnectNoSSL, use that instead of by passing the warning with unnecessary lines of code in your project?
Provides a standard method for connecting to a specified server without SSL verification. Useful when connecting to servers with self-signed certificates or when you wish to ignore SSL altogether
service_instance = connect.SmartConnectNoSSL(host=args.ip,
user=args.user,
pwd=args.password)