Similar to how it's done in dmcrpyt_unmap in master (
132e56615805cba0395898cf165b32b88600d633 ), the infernalis tests helper
that were deprecated by the addition of the deactivate / destroy
ceph-disk subcommand must try cryptsetup close a few times in some
contexts.
Signed-off-by: Loic Dachary <loic@dachary.org>
if partition['dmcrypt']:
holder = partition['dmcrypt']['holders'][0]
self.sh("cryptsetup close $(cat /sys/block/" + holder + "/dm/name) || true")
+ self.sh("cryptsetup close $(cat /sys/block/" + holder + "/dm/name) || true")
except:
pass
try:
if partition['dmcrypt']:
holder = partition['dmcrypt']['holders'][0]
self.sh("cryptsetup close $(cat /sys/block/" + holder + "/dm/name) || true")
+ self.sh("cryptsetup close $(cat /sys/block/" + holder + "/dm/name) || true")
except:
pass
self.sh("""