Added .unmount() to MapperDev()

This commit is contained in:
Anton Hvornum 2022-02-12 18:27:17 +01:00
parent 914ff38045
commit 852bc32077
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
3 changed files with 8 additions and 2 deletions

View File

@ -109,4 +109,12 @@ class MapperDev:
except SysCallError as err:
raise DiskError(f"Could not mount {self.path} to {target} using options {options}: {err}")
return True
def unmount(self, target :str, fs :Optional[str] = None, options :str = '') -> bool:
try:
SysCommand(f"/usr/bin/umount {self.path}")
except SysCallError as error:
raise DiskError(f"Could not unmount {self.path} properly: {error}")
return True

View File

@ -333,7 +333,6 @@ class SysCommandWorker:
for fileno, event in self.poll_object.poll(0.1):
try:
output = os.read(fileno, 8192)
print('Output:', output)
self.peak(output)
self._trace_log += output
except OSError as error:

View File

@ -187,7 +187,6 @@ class luks2:
pw_given = False
while cryptworker.is_alive():
if bytes(f'Enter passphrase for {partition.path}', 'UTF-8') in cryptworker and pw_given is False:
print('Entered the passphrase..')
cryptworker.write(password)
pw_given = True
time.sleep(0.25)