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:
parent
ca52c796a5
commit
1168efb01e
|
|
@ -20,12 +20,6 @@ class Filesystem:
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
|
|
||||||
def __enter__(self, *args, **kwargs):
|
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
|
return self
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue