From: John Mulligan Date: Thu, 27 Jul 2023 00:05:03 +0000 (-0400) Subject: cephadm: convert _write_osd_unit_poststop_commands to to use a DaemonIdentity argument X-Git-Tag: v19.0.0~479^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ed7a48c7edce29702a9b52633748855e0f3c8dc;p=ceph.git cephadm: convert _write_osd_unit_poststop_commands to to use a DaemonIdentity argument Signed-off-by: John Mulligan --- diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 8a631151dbe4..148fd062527e 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -3144,7 +3144,7 @@ def deploy_daemon_units( _write_stop_actions(ctx, cast(TextIO, f), container, timeout) if daemon_type == 'osd': assert osd_fsid - _write_osd_unit_poststop_commands(ctx, f, daemon_type, str(daemon_id), fsid, osd_fsid) + _write_osd_unit_poststop_commands(ctx, f, ident, osd_fsid) elif daemon_type == CephIscsi.daemon_type: _write_iscsi_unit_poststop_commands(ctx, f, daemon_type, str(daemon_id), fsid, data_dir) @@ -3259,19 +3259,17 @@ def _write_iscsi_unit_run_commands( def _write_osd_unit_poststop_commands( - ctx: CephadmContext, f: IO, daemon_type: str, daemon_id: str, fsid: str, osd_fsid: str + ctx: CephadmContext, f: IO, ident: 'DaemonIdentity', osd_fsid: str ) -> None: - ident = DaemonIdentity(fsid, daemon_type, daemon_id) poststop = get_ceph_volume_container( ctx, args=[ 'lvm', 'deactivate', - str(daemon_id), osd_fsid, + ident.daemon_id, osd_fsid, ], volume_mounts=get_container_mounts(ctx, ident), bind_mounts=get_container_binds(ctx, ident), - cname='ceph-%s-%s.%s-deactivate' % (fsid, daemon_type, - daemon_id), + cname='ceph-%s-%s.%s-deactivate' % (ident.fsid, ident.daemon_type, ident.daemon_id), ) _write_container_cmd_to_bash(ctx, f, poststop, 'deactivate osd')