Fix determine_block_devices to ignore missing devices. Do not return None value in a list of block devices to be used.

This commit is contained in:
Ryan Harper 2014-06-16 12:33:42 -05:00
parent fef7eaef56
commit d2162d4580
2 changed files with 7 additions and 2 deletions

View File

@ -56,7 +56,8 @@ def ensure_block_device(block_device):
if not is_block_device(bdev): if not is_block_device(bdev):
log('Failed to locate valid block device at %s' % bdev, level=ERROR) log('Failed to locate valid block device at %s' % bdev, level=ERROR)
raise # ignore missing block devices
return
return bdev return bdev

View File

@ -164,7 +164,11 @@ def determine_block_devices():
else: else:
bdevs = block_device.split(' ') bdevs = block_device.split(' ')
return [ensure_block_device(bd) for bd in bdevs] # attempt to ensure block devices, but filter out missing devs
_none = ['None', 'none', None]
valid_bdevs = [x for x in map(ensure_block_device, bdevs) if x not in _none]
log('Valid ensured block devices: %s' % valid_bdevs)
return valid_bdevs
def mkfs_xfs(bdev): def mkfs_xfs(bdev):