From: Alfredo Deza Date: Mon, 13 Aug 2018 19:41:46 +0000 (-0400) Subject: ceph-volume util.encryption if crypt path does not exist, skip it X-Git-Tag: v13.2.2~70^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4654d13ad91e3c0486f20c0841fe7dce15a4960d;p=ceph.git ceph-volume util.encryption if crypt path does not exist, skip it Signed-off-by: Alfredo Deza (cherry picked from commit 635f8e9e2ecdad5c54a599029bdad74e88fad600) --- diff --git a/src/ceph-volume/ceph_volume/util/encryption.py b/src/ceph-volume/ceph_volume/util/encryption.py index 0abe9b6c189..cc594a07e83 100644 --- a/src/ceph-volume/ceph_volume/util/encryption.py +++ b/src/ceph-volume/ceph_volume/util/encryption.py @@ -96,6 +96,10 @@ def dmcrypt_close(mapping): :param mapping: """ + if not os.path.exists(mapping): + logger.debug('device mapper path does not exist %s' % mapping) + logger.debug('will skip cryptsetup removal') + return process.run(['cryptsetup', 'remove', mapping])