~alexlist/charms/trusty/swift-storage/nrpe-rebased

« back to all changes in this revision

Viewing changes to hooks/swift_storage_utils.py

  • Committer: james.page at ubuntu
  • Date: 2014-06-19 08:34:43 UTC
  • mfrom: (27.3.2 ignore-missing-devs-v2)
  • Revision ID: james.page@ubuntu.com-20140619083443-pykjfv6q80onwavh
[rharper,r=james-page] Whitelist support for block devices

Allow for the user to specify devices that may not exist (and have swift-storage ignore them like cinder and ceph charms do). With this change we can use a common swift-storage block-device list that works across multiple different physical hosts where the block devices aren't all the same.

Show diffs side-by-side

added added

removed removed

Lines of Context:
164
164
    else:
165
165
        bdevs = block_device.split(' ')
166
166
 
167
 
    return [ensure_block_device(bd) for bd in bdevs]
 
167
    # attempt to ensure block devices, but filter out missing devs
 
168
    _none = ['None', 'none', None]
 
169
    valid_bdevs = [x for x in map(ensure_block_device, bdevs) if x not in _none]
 
170
    log('Valid ensured block devices: %s' % valid_bdevs)
 
171
    return valid_bdevs
168
172
 
169
173
 
170
174
def mkfs_xfs(bdev):