def mount(
dev,
fstype,
+ options,
):
# pick best-of-breed mount options based on fs type
- options = MOUNT_OPTIONS.get(fstype, '')
+ if options is None:
+ options = MOUNT_OPTIONS.get(fstype, '')
# mount
path = tempfile.mkdtemp(
def prepare(
disk,
fstype,
+ mkfs_args,
+ mount_options,
cluster_uuid,
):
"""
'--type={fstype}'.format(fstype=fstype),
]
args.extend(MKFS_ARGS.get(fstype, []))
+ if mkfs_args is not None:
+ args.extend(mkfs_args.split())
+ args.extend
args.extend([
'--',
dev,
except subprocess.CalledProcessError as e:
raise PrepareError(e)
- path = mount(dev=dev, fstype=fstype)
+ path = mount(dev=dev, fstype=fstype, options=mount_options)
try:
write_one_line(path, 'ceph_fsid', cluster_uuid)
osd_uuid = str(uuid.uuid4())
)
if args.fs_type is None:
args.fs_type = DEFAULT_FS_TYPE
+
+ mkfs_args = get_conf(
+ cluster=args.cluster,
+ variable='osd_fs_mkfs_arguments_{fstype}'.format(
+ fstype=args.fs_type,
+ ),
+ )
+
+ mount_options = get_conf(
+ cluster=args.cluster,
+ variable='osd_fs_mount_options_{fstype}'.format(
+ fstype=args.fs_type,
+ ),
+ )
+
prepare(
disk=args.disk,
fstype=args.fs_type,
+ mkfs_args=mkfs_args,
+ mount_options=mount_options,
cluster_uuid=args.cluster_uuid,
)
except PrepareError as e: