Skip to content

Commit

Permalink
Fix MBR conditional (#3192)
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles authored Feb 22, 2025
1 parent c364917 commit b83bc79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion archinstall/lib/disk/device_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def partition(
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
Expand Down
3 changes: 3 additions & 0 deletions archinstall/lib/models/device_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit b83bc79

Please sign in to comment.