ec2_ami_facts: return images in a consistent order (#40679)

* ec2_ami_facts: return images in a consistent order
This commit is contained in:
Sloane Hertel 2018-05-25 14:10:33 -04:00 committed by GitHub
parent 496d10f7a8
commit 9d30434b6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -234,6 +234,7 @@ def list_ec2_images(ec2_client, module):
# describing launch permissions of images owned by others is not permitted, but shouldn't cause failures
pass
images.sort(key=lambda e: e.get('creation_date', '')) # it may be possible that creation_date does not always exist
module.exit_json(images=images)