Somehow salt.utils.boto3 is "landing" as boto3 in sys.modules

This commit is contained in:
Pedro Algarvio 2017-02-17 13:49:30 +00:00
parent 1e2753c875
commit cb7a25e4a2
No known key found for this signature in database
GPG Key ID: BB36BF6584A298FF

View File

@ -104,12 +104,17 @@ def _has_required_boto3():
Returns True/False boolean depending on if Boto is installed and correct
version.
'''
if not HAS_BOTO3:
try:
if not HAS_BOTO3:
return False
elif LooseVersion(boto3.__version__) < LooseVersion(required_boto3_version):
return False
else:
return True
except AttributeError as exc:
if "has no attribute '__version__'" not in str(exc):
raise
return False
elif LooseVersion(boto3.__version__) < LooseVersion(required_boto3_version):
return False
else:
return True
def _has_required_moto():