Fix MBR conditional (#3192)

This commit is contained in:
codefiles 2025-02-22 18:20:06 -05:00 committed by GitHub
parent c364917324
commit b83bc79d91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -706,7 +706,7 @@ class DeviceHandler:
if partition_table is None:
raise ValueError('Modification is marked as wipe but no partitioning table was provided')
if partition_table.MBR and len(modification.partitions) > 3:
if partition_table.is_mbr() and len(modification.partitions) > 3:
raise DiskError('Too many partitions on disk, MBR disks can only have 3 primary partitions')
# WARNING: the entire device will be wiped and all data lost

View File

@ -202,6 +202,9 @@ class PartitionTable(Enum):
GPT = 'gpt'
MBR = 'msdos'
def is_mbr(self) -> bool:
return self == PartitionTable.MBR
class Units(Enum):
BINARY = 'binary'