From: Loic Dachary Date: Tue, 23 Feb 2016 11:03:26 +0000 (+0700) Subject: ceph-disk: destroy does not unmap block/journal X-Git-Tag: v10.1.0~200^2~15 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=977bf038a4664af31c8af0d6c70dd0b85ee4f09a;p=ceph.git ceph-disk: destroy does not unmap block/journal The dmcrypt boolean needs to be set for destroy to ensure the journal/block partitions are 'cryptsetup remove'. Signed-off-by: Loic Dachary --- diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index 6298fa3bb114..1159a246cb22 100755 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -3273,15 +3273,17 @@ def destroy_lookup_device(args, predicate, description): args.dmcrypt_key_dir) list_dev_osd(dmcrypt_path, {}, partition) dmcrypt_unmap(partition['uuid']) + dmcrypt = True + else: + dmcrypt = False if predicate(partition): - return partition + return (dmcrypt, partition) raise Error('found no device matching ', description) def main_destroy(args): osd_id = args.destroy_by_id path = args.path - dmcrypt = False target_dev = None if path: @@ -3290,11 +3292,11 @@ def main_destroy(args): path = os.path.realpath(path) if path: - target_dev = destroy_lookup_device( + (dmcrypt, target_dev) = destroy_lookup_device( args, lambda x: x.get('path') == path, path) elif osd_id: - target_dev = destroy_lookup_device( + (dmcrypt, target_dev) = destroy_lookup_device( args, lambda x: x.get('whoami') == osd_id, 'osd id ' + str(osd_id))