Ensure root device is listed in block device mappings
This commit is contained in:
		
							parent
							
								
									44bd6e8684
								
							
						
					
					
						commit
						c116c57eb8
					
				@ -115,7 +115,7 @@ DESCRIBE_IMAGES_RESPONSE = """<DescribeImagesResponse xmlns="http://ec2.amazonaw
 | 
				
			|||||||
          {% endif %}
 | 
					          {% endif %}
 | 
				
			||||||
          <description>{{ image.description }}</description>
 | 
					          <description>{{ image.description }}</description>
 | 
				
			||||||
          <rootDeviceType>ebs</rootDeviceType>
 | 
					          <rootDeviceType>ebs</rootDeviceType>
 | 
				
			||||||
          <rootDeviceName>/dev/sda</rootDeviceName>
 | 
					          <rootDeviceName>/dev/sda1</rootDeviceName>
 | 
				
			||||||
          <blockDeviceMapping>
 | 
					          <blockDeviceMapping>
 | 
				
			||||||
            <item>
 | 
					            <item>
 | 
				
			||||||
              <deviceName>/dev/sda1</deviceName>
 | 
					              <deviceName>/dev/sda1</deviceName>
 | 
				
			||||||
 | 
				
			|||||||
@ -57,6 +57,10 @@ def test_ami_create_and_delete():
 | 
				
			|||||||
        "Auto-created snapshot for AMI {0}".format(image.id))
 | 
					        "Auto-created snapshot for AMI {0}".format(image.id))
 | 
				
			||||||
    snapshot.volume_id.should.equal(volume.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
 | 
					    # Deregister
 | 
				
			||||||
    with assert_raises(EC2ResponseError) as ex:
 | 
					    with assert_raises(EC2ResponseError) as ex:
 | 
				
			||||||
        success = conn.deregister_image(image_id, dry_run=True)
 | 
					        success = conn.deregister_image(image_id, dry_run=True)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user