Added support for creation date to Ami

This commit is contained in:
Mervyn Russell 2016-08-26 13:43:17 +01:00
parent e92a8b7492
commit 27495e01e5
2 changed files with 2 additions and 0 deletions

1
moto/ec2/models.py Normal file → Executable file
View File

@ -911,6 +911,7 @@ class Ami(TaggedEC2Resource):
self.architecture = None
self.kernel_id = None
self.platform = None
self.creation_date = datetime.utcnow().isoformat()
if instance:
self.instance = instance

1
moto/ec2/responses/amis.py Normal file → Executable file
View File

@ -90,6 +90,7 @@ DESCRIBE_IMAGES_RESPONSE = """<DescribeImagesResponse xmlns="http://ec2.amazonaw
<kernelId>{{ image.kernel_id }}</kernelId>
<ramdiskId>ari-1a2b3c4d</ramdiskId>
<imageOwnerAlias>amazon</imageOwnerAlias>
<creationDate>{{ image.creation_date }}</creationDate>
<name>{{ image.name }}</name>
{% if image.platform %}
<platform>{{ image.platform }}</platform>