mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Boto3 error handle fix
This commit is contained in:
@@ -147,6 +147,8 @@ def get_aws_connection_info(module, boto3=False):
|
|||||||
elif boto3 and HAS_BOTO3:
|
elif boto3 and HAS_BOTO3:
|
||||||
# here we don't need to make an additional call, will default to 'us-east-1' if the below evaluates to None.
|
# here we don't need to make an additional call, will default to 'us-east-1' if the below evaluates to None.
|
||||||
region = botocore.session.get_session().get_config_variable('region')
|
region = botocore.session.get_session().get_config_variable('region')
|
||||||
|
elif boto3 and not HAS_BOTO3:
|
||||||
|
module.fail_json("Boto3 is required for this module. Please install boto3 and try again")
|
||||||
|
|
||||||
if not security_token:
|
if not security_token:
|
||||||
if 'AWS_SECURITY_TOKEN' in os.environ:
|
if 'AWS_SECURITY_TOKEN' in os.environ:
|
||||||
|
|||||||
Reference in New Issue
Block a user