EC2 DescribeImages reports correct rootDeviceType

Fixes LP 1024354

A root device type of instance-store was incorrectly reported for
boot-from-volume images (i.e. the analogue of EBS-backed AMIs).

When comparing the block device mapping device name with the root
device name, we now tolerate a missing leading '/dev/' path.

Change-Id: I1d3bda780deee52f5d41e3af041aba7e6305dfde
This commit is contained in:
Eoghan Glynn
2012-07-14 21:30:43 +01:00
parent 9a283c6b37
commit 76712b0c5e

View File

@@ -71,7 +71,7 @@ _dev = re.compile('^/dev/')
def strip_dev(device_name):
"""remove leading '/dev/'"""
return _dev.sub('', device_name)
return _dev.sub('', device_name) if device_name else device_name
_pref = re.compile('^((x?v|s)d)')