The code doesn't do any kind of retry right now, so adding that should help:
def _close_volume(self, **kwargs): """Closes the device (effectively removes the dm-crypt mapping).""" LOG.debug("closing encrypted volume %s", self.dev_path) utils.execute('cryptsetup', 'luksClose', self.dev_name, run_as_root=True, check_exit_code=True)
The code doesn't do any kind of retry right now, so adding that should help:
def _close_volume(self, **kwargs):
LOG.debug( "closing encrypted volume %s", self.dev_path)
utils. execute( 'cryptsetup' , 'luksClose', self.dev_name,
run_as_ root=True, check_exit_ code=True)
"""Closes the device (effectively removes the dm-crypt mapping)."""