我在 Python2.6 中使用pyVmomi并使用其中一种连接方法编写脚本:
service_instance = connect.SmartConnect(host=args.ip,
user=args.user,
pwd=args.password)
我收到以下警告:
/usr/lib/python2.6/site-packages/requests/packages/urllib3/connectionpool.py:734: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
有趣的是,我没有使用 pip 安装 urllib3(但它在/usr/lib/python2.6/site-packages/requests/packages/urllib3/中)。
我已经按照这里的建议尝试过
import urllib3
...
urllib3.disable_warnings()
但这并没有改变任何东西。