Merge pull request #136 from Torxed/torxed-135

Missing variable
This commit is contained in:
Anton Hvornum 2021-04-02 08:58:58 +00:00 committed by GitHub
commit 5f9966b5c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -94,8 +94,8 @@ class luks2():
else:
raise err
if b'Command successful.' not in b''.join(cmd_handle):
raise DiskError(f'Could not encrypt volume "{partition.path}": {o}')
if b'Command successful.' not in (cmd_output := b''.join(cmd_handle)):
raise DiskError(f'Could not encrypt volume "{partition.path}": {cmd_output}')
return key_file
@ -126,4 +126,4 @@ class luks2():
def format(self, path):
if (handle := sys_command(f"/usr/bin/cryptsetup -q -v luksErase {path}")).exit_code != 0:
raise DiskError(f'Could not format {path} with {self.filesystem} because: {b"".join(handle)}')
raise DiskError(f'Could not format {path} with {self.filesystem} because: {b"".join(handle)}')