ctx.image = _get_default_image(ctx)
return func(ctx)
+
return cast(FuncT, _default_image)
raise RuntimeError('uid/gid not found')
-
-
def deploy_daemon(ctx, fsid, daemon_type, daemon_id, c, uid, gid,
config=None, keyring=None,
osd_fsid=None,
) -> None:
# cmd
data_dir = get_data_dir(fsid, ctx.data_dir, daemon_type, daemon_id)
-
with open(data_dir + '/unit.run.new', 'w') as f, \
open(data_dir + '/unit.meta.new', 'w') as metaf:
f.write('set -e\n')
verbosity=CallVerbosity.DEBUG)
if enable:
call_throws(ctx, ['systemctl', 'enable', unit_name])
-
if start:
-
clean_cgroup(ctx, fsid, unit_name)
call_throws(ctx, ['systemctl', 'start', unit_name])
mounts[pathify(ctx.config)] = '/etc/ceph/ceph.conf:z'
if ctx.keyring:
mounts[pathify(ctx.keyring)] = '/etc/ceph/ceph.keyring:z'
-
if ctx.mount:
for _mount in ctx.mount:
split_src_dst = _mount.split(':')
##################################
+
@infer_fsid
@infer_image
@validate_fsid
# tmp config file
tmp_config = write_tmp(config, uid, gid)
mounts[tmp_config.name] = '/etc/ceph/ceph.conf:z'
+
if keyring:
# tmp keyring file
tmp_keyring = write_tmp(keyring, uid, gid)
help='daemon name (type.id)')
parser_deploy.add_argument(
'--fsid',
+ required=True,
help='cluster FSID')
parser_deploy.add_argument(
'--config', '-c',