Removed the GPT vs MBR lookup on __enter__ as it's no longer necessary to validate this on instance creation. load_layout() Uses this only to detect what partition table format it should use when wiping the drive. Other than that we only check if MBR and part numbers are > 3, that's the only use of this variable at this moment.

This commit is contained in:
Anton Hvornum 2021-11-12 11:22:30 +00:00
parent ca52c796a5
commit 1168efb01e
1 changed files with 0 additions and 6 deletions

View File

@ -20,12 +20,6 @@ class Filesystem:
self.mode = mode
def __enter__(self, *args, **kwargs):
# TODO: partition_table_type is hardcoded to GPT at the moment. This has to be changed.
if self.mode == self.blockdevice.partition_table_type:
log(f'Kept partition format {self.mode} for {self.blockdevice}', level=logging.DEBUG)
else:
raise DiskError(f'The selected partition table format {self.mode} does not match that of {self.blockdevice}.')
return self
def __repr__(self):