Ensure root device is listed in block device mappings

This commit is contained in:
Nuwan Goonasekera 2017-09-15 21:30:32 +05:30
parent 44bd6e8684
commit c116c57eb8
2 changed files with 5 additions and 1 deletions

View File

@ -115,7 +115,7 @@ DESCRIBE_IMAGES_RESPONSE = """<DescribeImagesResponse xmlns="http://ec2.amazonaw
{% endif %}
<description>{{ image.description }}</description>
<rootDeviceType>ebs</rootDeviceType>
<rootDeviceName>/dev/sda</rootDeviceName>
<rootDeviceName>/dev/sda1</rootDeviceName>
<blockDeviceMapping>
<item>
<deviceName>/dev/sda1</deviceName>

View File

@ -57,6 +57,10 @@ def test_ami_create_and_delete():
"Auto-created snapshot for AMI {0}".format(image.id))
snapshot.volume_id.should.equal(volume.id)
# root device should be in AMI's block device mappings
root_mapping = image.block_device_mapping.get(image.root_device_name)
root_mapping.should_not.be.none
# Deregister
with assert_raises(EC2ResponseError) as ex:
success = conn.deregister_image(image_id, dry_run=True)