Skip to content

Commit

Permalink
tui: rename filter_out_raid_member to avoid confusion with non-active…
Browse files Browse the repository at this point in the history
… RAIDs

Since RAID volumes are not all activated by default, this function
name became less intuitive.

Signed-off-by: Yann Dirson <[email protected]>
  • Loading branch information
ydirson committed Jan 24, 2023
1 parent 70e96e9 commit 6474110
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tui/installer/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,15 +645,15 @@ def sorted_disk_list():
return sorted(set(diskutil.getQualifiedDiskList()),
lambda x, y: len(x) == len(y) and cmp(x, y) or (len(x) - len(y)))

def filter_out_raid_member(diskEntries):
def filter_out_active_raid_member(diskEntries):
raid_disks = [de for de in diskEntries if diskutil.is_raid(de)]
raid_slaves = set(member for master in raid_disks for member in diskutil.getDeviceSlaves(master))
return [e for e in diskEntries if e not in raid_slaves]

# select drive to use as the Dom0 disk:
def select_primary_disk(answers):
button = None
diskEntries = filter_out_raid_member(sorted_disk_list())
diskEntries = filter_out_active_raid_member(sorted_disk_list())
entries = []
target_is_sr = {}
min_primary_disk_size = constants.min_primary_disk_size
Expand Down Expand Up @@ -757,7 +757,7 @@ def check_sr_space(answers):
return EXIT

def select_guest_disks(answers):
diskEntries = filter_out_raid_member(sorted_disk_list())
diskEntries = filter_out_active_raid_member(sorted_disk_list())

# CA-38329: filter out device mapper nodes (except primary disk) as these won't exist
# at XenServer boot and therefore cannot be added as physical volumes to Local SR.
Expand Down

0 comments on commit 6474110

Please sign in to comment.