index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-09-04 17:03:52 +0200 |
---|---|---|
committer | Anton Hvornum <anton@hvornum.se> | 2021-09-04 17:03:52 +0200 |
commit | 429006fe4b2775d4f28cfaa4ad86028fac56dccd (patch) | |
tree | 639db130e6770edb62df77e2ce0bd3e3d26ab3fe /archinstall/lib/disk.py | |
parent | 1814a19d6adb3e465df2a276cc87f85974f613c3 (diff) |
-rw-r--r-- | archinstall/lib/disk.py | 9 |
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py index 4a5b2f4c..bac46c3a 100644 --- a/archinstall/lib/disk.py +++ b/archinstall/lib/disk.py @@ -75,6 +75,11 @@ def sort_block_devices_based_on_performance(block_devices): return result +def filter_disks_below_size_in_gb(devices, gigabytes): + for disk in devices: + if disk.size >= gigabytes: + yield disk + def select_largest_device(devices, gigabytes, filter_out=None): if not filter_out: filter_out = [] @@ -84,10 +89,12 @@ def select_largest_device(devices, gigabytes, filter_out=None): if filter_device in copy_devices: copy_devices.pop(copy_devices.index(filter_device)) + copy_devices = list(filter_disks_below_size_in_gb(copy_devices, gigabytes)) + if not len(copy_devices): return None - return max(copy_devices, key=(lambda device : device.size if device.size > gigabytes else 0)) + return max(copy_devices, key=(lambda device : device.size)) def select_disk_larger_than_or_close_to(devices, gigabytes, filter_out=None): if not filter_out: |