From: Loic Dachary Date: Thu, 25 Feb 2016 05:44:58 +0000 (+0700) Subject: ceph-disk: make dmcrypt_unmap idempotent X-Git-Tag: v10.1.0~200^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=15db7feb8d4a0d647324a2789b1174a44cf78e6f;p=ceph.git ceph-disk: make dmcrypt_unmap idempotent Signed-off-by: Loic Dachary --- diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index 1159a246cb2..250d1e79eca 100755 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -1176,9 +1176,8 @@ def _dmcrypt_map( def dmcrypt_unmap( _uuid ): - """ - Removes the dmcrypt device with the given UUID. - """ + if not os.path.exists('/dev/mapper/' + _uuid): + return retries = 0 while True: try: