cephadm_agent.deploy_daemon_unit(config_js)
else:
if c:
- deploy_daemon_units(ctx, fsid, uid, gid, daemon_type, daemon_id,
- c, osd_fsid=osd_fsid, endpoints=endpoints,
- init_containers=init_containers)
+ deploy_daemon_units(
+ ctx,
+ ident,
+ uid,
+ gid,
+ c,
+ osd_fsid=osd_fsid,
+ endpoints=endpoints,
+ init_containers=init_containers,
+ )
else:
raise RuntimeError('attempting to deploy a daemon without a container image')
def deploy_daemon_units(
ctx: CephadmContext,
- fsid: str,
+ ident: 'DaemonIdentity',
uid: int,
gid: int,
- daemon_type: str,
- daemon_id: Union[int, str],
container: 'CephContainer',
enable: bool = True,
start: bool = True,
) -> None:
# cmd
- ident = DaemonIdentity(fsid, daemon_type, daemon_id)
+ # unpack values from ident because they're used very frequently
+ fsid = ident.fsid
+ daemon_type = ident.daemon_type
+ daemon_id = ident.daemon_id
+
data_dir = get_data_dir(ident, ctx.data_dir)
run_file_path = data_dir + '/unit.run'
meta_file_path = data_dir + '/unit.meta'
logger.info('Creating new units...')
make_var_run(ctx, fsid, uid, gid)
c = get_container(ctx, fsid, daemon_type, daemon_id)
- deploy_daemon_units(ctx, fsid, uid, gid, daemon_type, daemon_id, c,
- enable=True, # unconditionally enable the new unit
- start=(state == 'running' or ctx.force_start),
- osd_fsid=osd_fsid)
+ ident = DaemonIdentity(fsid, daemon_type, daemon_id)
+ deploy_daemon_units(
+ ctx,
+ ident,
+ uid,
+ gid,
+ c,
+ enable=True, # unconditionally enable the new unit
+ start=(state == 'running' or ctx.force_start),
+ osd_fsid=osd_fsid,
+ )
update_firewalld(ctx, daemon_type)
_cephadm.get_parm.return_value = config_json
c = _cephadm.get_container(ctx, fsid, 'iscsi', 'daemon_id')
- _cephadm.make_data_dir(
- ctx, _cephadm.DaemonIdentity(fsid, 'iscsi', 'daemon_id')
- )
+ ident = _cephadm.DaemonIdentity(fsid, 'iscsi', 'daemon_id')
+ _cephadm.make_data_dir(ctx, ident)
_cephadm.deploy_daemon_units(
ctx,
- fsid,
+ ident,
0, 0,
- 'iscsi',
- 'daemon_id',
c,
True, True
)
_cephadm.deploy_daemon_units(
ctx,
- fsid,
+ ident,
0, 0,
- 'snmp-gateway',
- 'daemon_id',
c,
True, True
)
_cephadm.deploy_daemon_units(
ctx,
- fsid,
+ ident,
0, 0,
- 'snmp-gateway',
- 'daemon_id',
c,
True, True
)
_cephadm.deploy_daemon_units(
ctx,
- fsid,
+ ident,
0, 0,
- 'snmp-gateway',
- 'daemon_id',
c,
True, True
)
_cephadm.create_daemon_dirs(ctx, ident, 0, 0)
_cephadm.deploy_daemon_units(
ctx,
- fsid,
+ ident,
0, 0,
- 'jaeger-collector',
- 'daemon_id',
c,
True, True
)
_cephadm.create_daemon_dirs(ctx, ident, 0, 0)
_cephadm.deploy_daemon_units(
ctx,
- fsid,
+ ident,
0, 0,
- 'jaeger-collector',
- 'daemon_id',
c,
True, True
)
_cephadm.create_daemon_dirs(ctx, ident, 0, 0)
_cephadm.deploy_daemon_units(
ctx,
- fsid,
+ ident,
0, 0,
- 'jaeger-agent',
- 'daemon_id',
c,
True, True
)