Skip to content

Commit 1f87057

Browse files
committed
marvin: set ssl cert verification only if ssl module supports it
ssl._create_unverified_context is not available for all Python 2.x environment, the fix would check if the attribute is available before trying to set it Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 7843a09 commit 1f87057

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tools/marvin/marvin/lib/vcenter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
from pyVim import connect
2020
import atexit
2121
import ssl
22-
ssl._create_default_https_context = ssl._create_unverified_context
22+
if hasattr(ssl, '_create_unverified_context'):
23+
ssl._create_default_https_context = ssl._create_unverified_context
2324

2425

2526
class Vcenter():

0 commit comments

Comments
 (0)