Merge "Cleanup _convert_block_devices"
This commit is contained in:
commit
4b801e28e3
@ -360,17 +360,14 @@ class DriverBlankBlockDevice(DriverVolumeBlockDevice):
|
||||
|
||||
|
||||
def _convert_block_devices(device_type, block_device_mapping):
|
||||
def _is_transformable(bdm):
|
||||
devices = []
|
||||
for bdm in block_device_mapping:
|
||||
try:
|
||||
device_type(bdm)
|
||||
devices.append(device_type(bdm))
|
||||
except _NotTransformable:
|
||||
return False
|
||||
return True
|
||||
|
||||
return [device_type(bdm)
|
||||
for bdm in block_device_mapping
|
||||
if _is_transformable(bdm)]
|
||||
pass
|
||||
|
||||
return devices
|
||||
|
||||
convert_swap = functools.partial(_convert_block_devices,
|
||||
DriverSwapBlockDevice)
|
||||
|
Loading…
x
Reference in New Issue
Block a user