modules.boto_lambda: __virtual__ return err msg.

Added messages when return False is boto libraries are missing or version is old.
This commit is contained in:
abednarik 2015-12-21 19:48:46 -03:00
parent 62c9514108
commit fd0805a0bc

View File

@ -116,11 +116,14 @@ def __virtual__():
# which was added in boto 2.8.0
# https://github.com/boto/boto/commit/33ac26b416fbb48a60602542b4ce15dcc7029f12
if not HAS_BOTO:
return False
return (False, 'The boto_lambda module could not be loaded: '
'boto libraries not found')
elif _LooseVersion(boto.__version__) < _LooseVersion(required_boto_version):
return False
return (False, 'The boto_lambda module could not be loaded: '
'boto version {0} or later must be installed.'.format(required_boto_version))
elif _LooseVersion(boto3.__version__) < _LooseVersion(required_boto3_version):
return False
return (False, 'The boto_lambda module could not be loaded: '
'boto version {0} or later must be installed.'.format(required_boto3_version))
else:
return True