mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
AWS: handle boto3 credential file parsing error (#53098)
Fixes: #53051 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
parent
5f577c7e79
commit
0f353ed99d
1 changed files with 2 additions and 1 deletions
|
@ -117,7 +117,8 @@ def boto3_conn(module, conn_type=None, resource=None, region=None, endpoint=None
|
|||
return _boto3_conn(conn_type=conn_type, resource=resource, region=region, endpoint=endpoint, **params)
|
||||
except ValueError as e:
|
||||
module.fail_json(msg="Couldn't connect to AWS: %s" % to_native(e))
|
||||
except (botocore.exceptions.ProfileNotFound, botocore.exceptions.PartialCredentialsError, botocore.exceptions.NoCredentialsError) as e:
|
||||
except (botocore.exceptions.ProfileNotFound, botocore.exceptions.PartialCredentialsError,
|
||||
botocore.exceptions.NoCredentialsError, botocore.exceptions.ConfigParseError) as e:
|
||||
module.fail_json(msg=to_native(e))
|
||||
except botocore.exceptions.NoRegionError as e:
|
||||
module.fail_json(msg="The %s module requires a region and none was found in configuration, "
|
||||
|
|
Loading…
Reference in a new issue