Improved error handling in luks2().close()
This commit is contained in:
parent
3129cf79f4
commit
216ca90b29
|
|
@ -201,8 +201,8 @@ class luks2:
|
|||
return self.mapdev
|
||||
|
||||
def close(self, mountpoint :Optional[str] = None) -> bool:
|
||||
if not mountpoint:
|
||||
mountpoint = self.mapdev
|
||||
if not mountpoint and self.mapdev:
|
||||
mountpoint = self.mapdev.path
|
||||
|
||||
if mountpoint:
|
||||
SysCommand(f'/usr/bin/cryptsetup close {mountpoint}')
|
||||
|
|
|
|||
Loading…
Reference in New Issue