Merge pull request #704 from archlinux/torxed-fix-689

Fix #689 by adding a exception to filesystem.parted() on failure
This commit is contained in:
Anton Hvornum 2021-11-09 14:46:57 +00:00 committed by GitHub
commit cd07dafaac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -143,7 +143,10 @@ class Filesystem:
:param string: A raw string passed to /usr/bin/parted -s <string>
:type string: str
"""
return self.raw_parted(string).exit_code == 0
if (parted_handle := self.raw_parted(string)).exit_code == 0:
return True
else:
raise DiskError(f"Parted failed to add a partition: {parted_handle}")
def use_entire_disk(self, root_filesystem_type='ext4') -> Partition:
# TODO: Implement this with declarative profiles instead.