]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: convert _write_osd_unit_poststop_commands to to use a DaemonIdentity argument
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 27 Jul 2023 00:05:03 +0000 (20:05 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Mon, 11 Sep 2023 19:23:05 +0000 (15:23 -0400)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index 8a631151dbe4ef4169211db99c64f86bc40190a5..148fd062527e35eb8c1fedee93cbb486b3f2b6aa 100755 (executable)
@@ -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')