mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
[ec2_ami] Add missing parameters while handling botocore Exceptions. Fixes TypeError exception (#39105)
This commit is contained in:
parent
ce796bc34d
commit
d36537513e
1 changed files with 2 additions and 2 deletions
|
@ -626,9 +626,9 @@ def get_image_by_id(module, connection, image_id):
|
||||||
result['ProductCodes'] = connection.describe_image_attribute(Attribute='productCodes', ImageId=image_id)['ProductCodes']
|
result['ProductCodes'] = connection.describe_image_attribute(Attribute='productCodes', ImageId=image_id)['ProductCodes']
|
||||||
except botocore.exceptions.ClientError as e:
|
except botocore.exceptions.ClientError as e:
|
||||||
if e.response['Error']['Code'] != 'InvalidAMIID.Unavailable':
|
if e.response['Error']['Code'] != 'InvalidAMIID.Unavailable':
|
||||||
module.fail_json_aws(e, msg="Error retrieving image attributes" % image_id)
|
module.fail_json_aws(e, msg="Error retrieving image attributes %s" % image_id)
|
||||||
except botocore.exceptions.BotoCoreError as e:
|
except botocore.exceptions.BotoCoreError as e:
|
||||||
module.fail_json_aws(e, msg="Error retrieving image attributes" % image_id)
|
module.fail_json_aws(e, msg="Error retrieving image attributes %s" % image_id)
|
||||||
return result
|
return result
|
||||||
module.fail_json(msg="Invalid number of instances (%s) found for image_id: %s." % (str(len(images)), image_id))
|
module.fail_json(msg="Invalid number of instances (%s) found for image_id: %s." % (str(len(images)), image_id))
|
||||||
except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
|
except (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) as e:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue