Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2023-09-14 20:04:25 +1000
committerGitHub <noreply@github.com>2023-09-14 20:04:25 +1000
commitc8e0b9a4d685b941e3b406bc6f8ecfaef60e1f5f (patch)
tree7743c86d107c93907770c728a21fa88296395708
parent2252dcf9bb0f07f5f331b66395d24dce54d50a44 (diff)
Default to unknown on partition types (#2037)
Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
-rw-r--r--archinstall/lib/disk/device_model.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/archinstall/lib/disk/device_model.py b/archinstall/lib/disk/device_model.py
index b1d07d98..8ea4e06e 100644
--- a/archinstall/lib/disk/device_model.py
+++ b/archinstall/lib/disk/device_model.py
@@ -20,6 +20,7 @@ from ..exceptions import DiskError, SysCallError
from ..general import SysCommand
from ..output import debug, error
from ..storage import storage
+from ..output import info
if TYPE_CHECKING:
_: Any
@@ -509,13 +510,15 @@ class BDevice:
class PartitionType(Enum):
Boot = 'boot'
Primary = 'primary'
+ _Unknown = 'unknown'
@classmethod
def get_type_from_code(cls, code: int) -> PartitionType:
if code == parted.PARTITION_NORMAL:
return PartitionType.Primary
-
- raise DiskError(f'Partition code not supported: {code}')
+ else:
+ info(f'Partition code not supported: {code}')
+ return PartitionType._Unknown
def get_partition_code(self) -> Optional[int]:
if self == PartitionType.Primary:
@@ -659,9 +662,9 @@ class PartitionModification:
if partition_info.btrfs_subvol_infos:
mountpoint = None
subvol_mods = []
- for info in partition_info.btrfs_subvol_infos:
+ for i in partition_info.btrfs_subvol_infos:
subvol_mods.append(
- SubvolumeModification.from_existing_subvol_info(info)
+ SubvolumeModification.from_existing_subvol_info(i)
)
else:
mountpoint = partition_info.mountpoints[0] if partition_info.mountpoints else None