File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 9797from __future__ import absolute_import
9898import logging
9999import copy
100+ import sys
100101
101102# Import Salt Libs
102103from salt .exceptions import CommandExecutionError , ArgumentValueError
103104from salt .utils .dictdiffer import recursive_diff
104105from salt .utils .listdiffer import list_diff
105106
107+ # External libraries
108+ try :
109+ from pyVmomi import VmomiSupport
110+ HAS_PYVMOMI = True
111+ except ImportError :
112+ HAS_PYVMOMI = False
113+
106114# Get Logging Started
107115log = logging .getLogger (__name__ )
108- # TODO change with vcenter
109- ALLOWED_PROXY_TYPES = ['esxcluster' , 'vcenter' ]
110- LOGIN_DETAILS = {}
111116
112117
113118def __virtual__ ():
119+ if not HAS_PYVMOMI :
120+ return False , 'State module did not load: pyVmomi not found'
121+
122+ # We check the supported vim versions to infer the pyVmomi version
123+ if 'vim25/6.0' in VmomiSupport .versionMap and \
124+ sys .version_info > (2 , 7 ) and sys .version_info < (2 , 7 , 9 ):
125+
126+ return False , ('State module did not load: Incompatible versions '
127+ 'of Python and pyVmomi present. See Issue #29537.' )
114128 return True
115129
116130
You can’t perform that action at this time.
0 commit comments