]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: make dmcrypt_unmap idempotent
authorLoic Dachary <ldachary@redhat.com>
Thu, 25 Feb 2016 05:44:58 +0000 (12:44 +0700)
committerLoic Dachary <ldachary@redhat.com>
Fri, 4 Mar 2016 02:13:35 +0000 (09:13 +0700)
Signed-off-by: Loic Dachary <loic@dachary.org>
src/ceph-disk/ceph_disk/main.py

index 1159a246cb22980af47be788ed3b683445b25662..250d1e79eca26ae7fc0a066951770c7377457158 100755 (executable)
@@ -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: