raise Error('unable to create symlink %s -> %s' % (path, target))
+def get_mount_options(cluster, fs_type):
+ mount_options = get_conf(
+ cluster,
+ variable='osd_mount_options_{fstype}'.format(
+ fstype=fs_type,
+ ),
+ )
+ if mount_options is None:
+ mount_options = get_conf(
+ cluster,
+ variable='osd_fs_mount_options_{fstype}'.format(
+ fstype=fs_type,
+ ),
+ )
+ else:
+ # remove whitespaces
+ mount_options = "".join(mount_options.split())
+ return mount_options
+
+
class Device(object):
def __init__(self, path, args):
),
)
- self.mount_options = get_conf(
- cluster=self.args.cluster,
- variable='osd_mount_options_{fstype}'.format(
- fstype=self.args.fs_type,
- ),
- )
- if self.mount_options is None:
- self.mount_options = get_conf(
- cluster=self.args.cluster,
- variable='osd_fs_mount_options_{fstype}'.format(
- fstype=self.args.fs_type,
- ),
- )
- else:
- # remove whitespaces
- self.mount_options = "".join(self.mount_options.split())
+ self.mount_options = get_mount_options(cluster=self.args.cluster,
+ fs_type=self.args.fs_type)
if self.args.osd_uuid is None:
self.args.osd_uuid = str(uuid.uuid4())
# TODO always using mount options from cluster=ceph for
# now; see http://tracker.newdream.net/issues/3253
- mount_options = get_conf(
- cluster='ceph',
- variable='osd_mount_options_{fstype}'.format(
- fstype=fstype,
- ),
- )
-
- if mount_options is None:
- mount_options = get_conf(
- cluster='ceph',
- variable='osd_fs_mount_options_{fstype}'.format(
- fstype=fstype,
- ),
- )
-
- # remove whitespaces from mount_options
- if mount_options is not None:
- mount_options = "".join(mount_options.split())
+ mount_options = get_mount_options(cluster='ceph', fs_type=fstype)
path = mount(dev=dev, fstype=fstype, options=mount_options)
fs_type = get_dev_fs(dev_to_mount)
if fs_type is not None:
+ mount_options = get_mount_options(cluster='ceph',
+ fs_type=fs_type)
try:
tpath = mount(dev=dev_to_mount,
- fstype=fs_type, options='')
+ fstype=fs_type, options=mount_options)
try:
for name in Space.NAMES:
space_uuid = get_oneliner(tpath,