Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1641: [EC2] Add missing "creation_date" NodeImage extra #1642

Merged
merged 1 commit into from Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Expand Up @@ -29,6 +29,10 @@ Compute
(GITHUB-1595)
[Miguel Caballer - @micafer]

- [EC2] Add missing ``creation_date`` NodeImage extra.
(GITHUB-1641)
[Thomas JOUANNOT - @mazerty]

Storage
~~~~~~~

Expand Down
1 change: 1 addition & 0 deletions libcloud/compute/drivers/ec2.py
Expand Up @@ -674,6 +674,7 @@
"ramdisk_id": {"xpath": "ramdiskId", "transform_func": str},
"ena_support": {"xpath": "enaSupport", "transform_func": str},
"sriov_net_support": {"xpath": "sriovNetSupport", "transform_func": str},
"creation_date": {"xpath": "creationDate", "transform_func": parse_date},
},
"network": {
"state": {"xpath": "state", "transform_func": str},
Expand Down
2 changes: 2 additions & 0 deletions libcloud/test/compute/fixtures/ec2/describe_images.xml
Expand Up @@ -36,6 +36,7 @@
</blockDeviceMapping>
<virtualizationType>paravirtual</virtualizationType>
<hypervisor>xen</hypervisor>
<creationDate>2021-01-10T18:24:00.000Z</creationDate>
</item>
<item>
<imageId>ami-85b2a8ae</imageId>
Expand Down Expand Up @@ -67,6 +68,7 @@
</blockDeviceMapping>
<virtualizationType>paravirtual</virtualizationType>
<hypervisor>xen</hypervisor>
<creationDate>2021-01-10T18:25:00.000Z</creationDate>
</item>
</imagesSet>
</DescribeImagesResponse>
3 changes: 3 additions & 0 deletions libcloud/test/compute/test_ec2.py
Expand Up @@ -585,6 +585,7 @@ def test_list_images(self):
self.assertEqual(ephemeral, "ephemeral0")
billing_product1 = images[0].extra["billing_products"][0]
self.assertEqual(billing_product1, "ab-5dh78019")
self.assertIsInstance(images[0].extra["creation_date"], datetime)

location = "123456788908/Test Image 2"
self.assertEqual(images[1].id, "ami-85b2a8ae")
Expand All @@ -595,6 +596,7 @@ def test_list_images(self):
billing_product2 = images[1].extra["billing_products"][0]
self.assertEqual(billing_product2, "as-6dr90319")
self.assertEqual(size, 20)
self.assertIsInstance(images[1].extra["creation_date"], datetime)

def test_list_images_with_image_ids(self):
EC2MockHttp.type = "ex_imageids"
Expand All @@ -615,6 +617,7 @@ def test_get_image(self):
self.assertEqual(image.extra["architecture"], "x86_64")
self.assertEqual(len(image.extra["block_device_mapping"]), 2)
self.assertEqual(image.extra["billing_products"][0], "ab-5dh78019")
self.assertIsInstance(image.extra["creation_date"], datetime)

def test_copy_image(self):
image = self.driver.list_images()[0]
Expand Down