mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Added python/pyvmomi compatibility check to salt.modules.vsphere
This commit is contained in:
parent
5f30477a6a
commit
2f55841037
@ -193,7 +193,7 @@ except ImportError:
|
||||
HAS_JSONSCHEMA = False
|
||||
|
||||
try:
|
||||
from pyVmomi import vim, vmodl
|
||||
from pyVmomi import vim, vmodl, VmomiSupport
|
||||
HAS_PYVMOMI = True
|
||||
except ImportError:
|
||||
HAS_PYVMOMI = False
|
||||
@ -211,6 +211,17 @@ __proxyenabled__ = ['esxi', 'esxcluster', 'esxdatacenter']
|
||||
|
||||
|
||||
def __virtual__():
|
||||
if not HAS_JSONSCHEMA:
|
||||
return False, 'Execution module did not load: jsonschema not found'
|
||||
if not HAS_PYVMOMI:
|
||||
return False, 'Execution module did not load: pyVmomi not found'
|
||||
|
||||
# We check the supported vim versions to infer the pyVmomi version
|
||||
if 'vim25/6.0' in VmomiSupport.versionMap and \
|
||||
sys.version_info > (2, 7) and sys.version_info < (2, 7, 9):
|
||||
|
||||
return False, ('Execution module did not load: Incompatible versions '
|
||||
'of Python and pyVmomi present. See Issue #29537.')
|
||||
return __virtualname__
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user