Project

General

Profile

Bug #7157 ยป ceph-disk.diff

My hack around the ceph-disk issue - Stuart Longland, 01/21/2014 03:44 PM

View differences:

/tmp/ceph-disk.patched 2014-01-22 09:50:37.109719279 +1000
Mounts a device with given filessystem type and
mount options to a tempfile path under /var/lib/ceph/tmp.
"""
# sanity check: none of the arguments are None
if dev is None:
raise ValueError('dev may not be None')
if fstype is None:
raise ValueError('fstype may not be None')
# pick best-of-breed mount options based on fs type
if options is None:
options = MOUNT_OPTIONS.get(fstype, '')
......
ptype = get_partition_type(dev)
if ptype == 'ceph data':
fs_type = get_dev_fs(dev)
try:
tpath = mount(dev=dev, fstype=fs_type, options='')
if fs_type is not None:
try:
journal_uuid = get_oneliner(tpath, 'journal_uuid')
if journal_uuid:
journal_map[journal_uuid.lower()] = dev
finally:
unmount(tpath)
except MountError:
pass
tpath = mount(dev=dev, fstype=fs_type, options='')
try:
journal_uuid = get_oneliner(tpath, 'journal_uuid')
if journal_uuid:
journal_map[journal_uuid.lower()] = dev
finally:
unmount(tpath)
except MountError:
pass
for base, parts in sorted(partmap.iteritems()):
if parts:
    (1-1/1)