From c8c5eb501cf71d5e7dde5d0e5d1092780b8ef55e Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Tue, 5 Apr 2022 11:42:15 +0200 Subject: [PATCH] filesystem: evaluate only once the status of the raid / LVM creation button When refreshing the filesystem GUI, we used to set the status (i.e., enabled or disabled) of the "Create LVM volume group" and "Create software RAID" buttons multiple times ; once for each disk found. When multiple disks are listed, this creates intermediate status changes that are not wanted, e.g.: * "Create software RAID" button gets set to disabled after finding a first unpartitioned disk ; * "Create software RAID" button is set again to disabled after finding a partitioned disk (with no unmounted partitions) ; * "Create software RAID" button is set to enabled after finding a second unpartitioned disk. Fixed by evaluating the status of the buttons only once after looping through all disks. Signed-off-by: Olivier Gayot --- subiquity/ui/views/filesystem/filesystem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subiquity/ui/views/filesystem/filesystem.py b/subiquity/ui/views/filesystem/filesystem.py index f5184e70..e49f410b 100644 --- a/subiquity/ui/views/filesystem/filesystem.py +++ b/subiquity/ui/views/filesystem/filesystem.py @@ -516,8 +516,8 @@ class FilesystemView(BaseView): raid_devices.add(p) if p.ok_for_lvm_vg: lvm_devices.add(p) - self._create_raid_btn.enabled = len(raid_devices) > 1 - self._create_vg_btn.enabled = len(lvm_devices) > 0 + self._create_raid_btn.enabled = len(raid_devices) > 1 + self._create_vg_btn.enabled = len(lvm_devices) > 0 self.mount_list.refresh_model_inputs() self.avail_list.refresh_model_inputs() self.used_list.refresh_model_inputs()