From: Igor Fedotov Date: Thu, 9 Mar 2023 13:29:55 +0000 (+0300) Subject: ceph-volume: close encrypted volumes on deactivate X-Git-Tag: v16.2.14~22^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=604756cbf04701c38caaaf0cb19a84a2018313a4;p=ceph.git ceph-volume: close encrypted volumes on deactivate Fixes: https://tracker.ceph.com/issues/58943 Signed-off-by: Igor Fedotov (cherry picked from commit d8f163d1f55d8234824e57fc6f851db9292fa972) --- diff --git a/src/ceph-volume/ceph_volume/devices/lvm/deactivate.py b/src/ceph-volume/ceph_volume/devices/lvm/deactivate.py index 46846a1dcbed..0cc8d71ae64d 100644 --- a/src/ceph-volume/ceph_volume/devices/lvm/deactivate.py +++ b/src/ceph-volume/ceph_volume/devices/lvm/deactivate.py @@ -28,7 +28,7 @@ def deactivate_osd(osd_id=None, osd_uuid=None): for lv in lvs: if lv.tags.get('ceph.encrypted', '0') == '1': - encryption.dmcrypt_close(lv.lv_uuid) + encryption.dmcrypt_close(mapping=lv.lv_uuid, skip_path_check=True) class Deactivate(object): diff --git a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_deactivate.py b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_deactivate.py index 4b8304ce6a99..044fd35196fd 100644 --- a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_deactivate.py +++ b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_deactivate.py @@ -56,4 +56,4 @@ class TestDeactivate(object): p_get_lvs.return_value = [FooVolume] deactivate.deactivate_osd(0) - p_dm_close.assert_called_with('123') + p_dm_close.assert_called_with(mapping='123', skip_path_check=True)