Patch 1 should prevent quite a few bugs in the beta cycle by not even trying to offer editing of devices we aren't absolutely sure we can edit.
Patch 2 is just a small usability improvement for people who want to reuse existing block devices.
Patch 3 is a step toward my vision for handling broken lvm/md setups, and also fixes a bug when unlocking multiple encrypted PVs that are part of the same VG.
The obvious example is a VG with no LVs, which could happen because it actually has no LVs or because only some of its encrypted PVs have been unlocked.
This may end up being how we handle degraded md and incomplete lvm in the future. --- pyanaconda/ui/gui/spokes/custom.glade | 89 ++++++++++++++++++++++++++++++++- pyanaconda/ui/gui/spokes/custom.py | 21 +++++++- 2 files changed, 106 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade index 9398b06..70ec694 100644 --- a/pyanaconda/ui/gui/spokes/custom.glade +++ b/pyanaconda/ui/gui/spokes/custom.glade @@ -1191,7 +1191,7 @@ you'll be able to view their details here.</property> <placeholder/> </child> <child> - <object class="GtkBox" id="box5"> + <object class="GtkBox" id="encryptedDeviceBox"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="orientation">vertical</property> @@ -1332,6 +1332,93 @@ you'll be able to view their details here.</property> <child type="tab"> <placeholder/> </child> + <child> + <object class="GtkBox" id="uneditableDeviceBox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkBox" id="box17"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="uneditableDeviceLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Selected Device</property> + <attributes> + <attribute name="font-desc" value="Cantarell Bold 10"/> + <attribute name="weight" value="bold"/> + <attribute name="scale" value="1.2"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="uneditableDeviceDescriptionLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Device description</property> + <attributes> + <attribute name="font-desc" value="Cantarell Italic 10"/> + <attribute name="style" value="italic"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkSeparator" id="separator3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="uneditableDeviceOptionsLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">This device cannot be edited directly. You can remove it or select a different device.</property> + <property name="wrap">True</property> + <attributes> + <attribute name="font-desc" value="Cantarell 11"/> + </attributes> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + </object> + <packing> + <property name="position">3</property> + </packing> + </child> + <child type="tab"> + <placeholder/> + </child> </object> <packing> <property name="left_attach">1</property> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 515a9a7..a4097aa 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -89,6 +89,7 @@ __all__ = ["CustomPartitioningSpoke"] NOTEBOOK_LABEL_PAGE = 0 NOTEBOOK_DETAILS_PAGE = 1 NOTEBOOK_LUKS_PAGE = 2 +NOTEBOOK_UNEDITABLE_PAGE = 3
new_install_name = N_("New %s %s Installation") % (productName, productVersion) unrecoverable_error_msg = N_("Storage configuration reset due to unrecoverable " @@ -800,9 +801,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): # just-removed device return
+ if self._partitionsNotebook.get_current_page() != NOTEBOOK_DETAILS_PAGE: + return + log.info("ui: saving changes to device %s" % device.name)
- # TODO: member type, disk set + # TODO: member type
size = self.builder.get_object("sizeSpinner").get_value() log.debug("new size: %s" % size) @@ -1814,7 +1818,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): log.debug("new selector: %s" % selector._device) nb_page = self._partitionsNotebook.get_current_page() log.debug("notebook page = %s" % nb_page) - if nb_page != NOTEBOOK_LUKS_PAGE: + if nb_page == NOTEBOOK_DETAILS_PAGE: self._save_right_side(self._current_selector)
self._current_selector.set_chosen(False) @@ -1831,6 +1835,17 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._configButton.set_sensitive(False) self._removeButton.set_sensitive(True) return + elif getDeviceType(selector._device) is None: + self._partitionsNotebook.set_current_page(NOTEBOOK_UNEDITABLE_PAGE) + selectedDeviceLabel = self.builder.get_object("uneditableDeviceLabel") + selectedDeviceDescLabel = self.builder.get_object("uneditableDeviceDescriptionLabel") + selectedDeviceLabel.set_text(selector._device.name) + selectedDeviceDescLabel.set_text(self._description(selector._device.type)) + selector.set_chosen(True) + self._current_selector = selector + self._configButton.set_sensitive(False) + self._removeButton.set_sensitive(True) + return
# Make sure we're showing details instead of the "here's how you create # a new OS" label. @@ -1853,7 +1868,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): if self._current_selector: nb_page = self._partitionsNotebook.get_current_page() log.debug("notebook page = %s" % nb_page) - if nb_page != NOTEBOOK_LUKS_PAGE: + if nb_page == NOTEBOOK_DETAILS_PAGE: self._save_right_side(self._current_selector)
self._current_selector.set_chosen(False)
--- pyanaconda/ui/gui/spokes/custom.py | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index a4097aa..329c639 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -682,8 +682,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): page = UnknownPage() page.pageTitle = _("Unknown")
- for u in self.unusedDevices: - selector = page.addDevice(u.format.name, Size(spec="%f MB" % u.size), None, self.on_selector_clicked) + for u in sorted(self.unusedDevices, key=lambda d: d.name): + selector = page.addDevice(u.name, Size(spec="%f MB" % u.size), u.format.name, self.on_selector_clicked) selector._device = u
page.show_all()
Our current plan for handling of incomplete preexisting LVM does not involve filtering out or ignoring anything, so this is a good first step. --- pyanaconda/storage/devicetree.py | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py index 3fad2c7..3044ef4 100644 --- a/pyanaconda/storage/devicetree.py +++ b/pyanaconda/storage/devicetree.py @@ -1695,10 +1695,6 @@ class DeviceTree(object): self.addIgnoredDisk(parent.name) devicelibs.lvm.lvm_cc_addFilterRejectRegexp(parent.name)
- # Address the inconsistencies present in the tree leaves. - for leaf in filter(lambda leaf: leaf.type == "lvmvg" and not leaf.complete, self.leaves): - leafInconsistencies(leaf) - for md in [d for d in self.leaves if d.type == "mdarray" and len(d.parents) < d.memberDevices]: log.debug("removing incomplete/degraded md array %s" % md.name) try:
On 11/20/2012 10:55 AM, David Lehman wrote:
Patch 1 should prevent quite a few bugs in the beta cycle by not even trying to offer editing of devices we aren't absolutely sure we can edit.
Patch 2 is just a small usability improvement for people who want to reuse existing block devices.
Patch 3 is a step toward my vision for handling broken lvm/md setups, and also fixes a bug when unlocking multiple encrypted PVs that are part of the same VG.
ACK
anaconda-patches@lists.fedorahosted.org