The manual partitioning window in the installer allowed users to type in and attempt to set a label on PPC PReP Boot filesystems. This would cause the installer to register an error and go back to the previous settings. Updated the behavior to automatically clear the label if the PPC PReP Boot filesystem type is chosen and disabled the label entry field to prevent users from being able to enter information that is invalid for this filesystem type.
Resolves rhbz#1172773 --- pyanaconda/ui/gui/spokes/custom.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 77f3414..7be0453 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -1389,7 +1389,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._labelEntry.set_text(device.format.label) else: self._labelEntry.set_text("") - fancy_set_sensitive(self._labelEntry, True) + + # Prep Boot Cannot Have Labels Set - so Don't Even Allow It + if device.format.type == "prepboot": + fancy_set_sensitive(self._labelEntry, False) + else: + fancy_set_sensitive(self._labelEntry, True)
self._device_size_text = device.size.humanReadable(max_places=2) self._sizeEntry.set_text(self._device_size_text) @@ -2308,6 +2313,13 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): fmt = getFormat(new_type) fancy_set_sensitive(self._mountPointEntry, fmt.mountable)
+ # Prep Boot Cannot Have Labels Set - so Don't Even Allow It + if fmt.type == "prepboot": + fancy_set_sensitive(self._labelEntry, False) + self._labelEntry.set_text("") + else: + fancy_set_sensitive(self._labelEntry, True) + def _populate_container(self, device=None): """ Set up the vg widgets for lvm or hide them for other types. """ device_type = self._get_current_device_type()
On 05/01/2015 10:24 AM, Robert Marshall wrote:
The manual partitioning window in the installer allowed users to type in and attempt to set a label on PPC PReP Boot filesystems. This would cause the installer to register an error and go back to the previous settings. Updated the behavior to automatically clear the label if the PPC PReP Boot filesystem type is chosen and disabled the label entry field to prevent users from being able to enter information that is invalid for this filesystem type.
Resolves rhbz#1172773
pyanaconda/ui/gui/spokes/custom.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 77f3414..7be0453 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -1389,7 +1389,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._labelEntry.set_text(device.format.label) else: self._labelEntry.set_text("")
fancy_set_sensitive(self._labelEntry, True)
# Prep Boot Cannot Have Labels Set - so Don't Even Allow It
if device.format.type == "prepboot":
fancy_set_sensitive(self._labelEntry, False)
else:
fancy_set_sensitive(self._labelEntry, True) self._device_size_text = device.size.humanReadable(max_places=2) self._sizeEntry.set_text(self._device_size_text)
@@ -2308,6 +2313,13 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): fmt = getFormat(new_type) fancy_set_sensitive(self._mountPointEntry, fmt.mountable)
# Prep Boot Cannot Have Labels Set - so Don't Even Allow It
if fmt.type == "prepboot":
fancy_set_sensitive(self._labelEntry, False)
self._labelEntry.set_text("")
else:
fancy_set_sensitive(self._labelEntry, True)
def _populate_container(self, device=None): """ Set up the vg widgets for lvm or hide them for other types. """ device_type = self._get_current_device_type()
Any solution to this should be a general one. The only formats that allow setting a label are swap and proper filesystems, and only a subset of them allow changing the label on existing formatting.
Hopefully this is fixed on master. It might be a good idea to speak with mulhern about how best to achieve a general solution using the code she wrote related to labels.
David
The manual partitioning window in the installer allowed users to type in and attempt to set a label on PPC PReP Boot filesystems. This would cause the installer to register an error and go back to the previous settings. Updated the behavior to automatically clear the label if the PPC PReP Boot filesystem type is chosen and disabled the label entry field to prevent users from being able to enter information that is invalid for this filesystem type. This fix will also do the same for any other filesystem format that does not support labels.
Resolves rhbz#1172773 --- pyanaconda/ui/gui/spokes/custom.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 77f3414..0644cc6 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -1389,7 +1389,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._labelEntry.set_text(device.format.label) else: self._labelEntry.set_text("") - fancy_set_sensitive(self._labelEntry, True) + + # Only Allow Labels on Filesystems Supporting It + if device.format.labeling(): + fancy_set_sensitive(self._labelEntry, True) + else: + fancy_set_sensitive(self._labelEntry, False)
self._device_size_text = device.size.humanReadable(max_places=2) self._sizeEntry.set_text(self._device_size_text) @@ -2308,6 +2313,13 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): fmt = getFormat(new_type) fancy_set_sensitive(self._mountPointEntry, fmt.mountable)
+ # Only Allow Labels on Filesystems Supporting It + if fmt.labeling(): + fancy_set_sensitive(self._labelEntry, True) + else: + fancy_set_sensitive(self._labelEntry, False) + self._labelEntry.set_text("") + def _populate_container(self, device=None): """ Set up the vg widgets for lvm or hide them for other types. """ device_type = self._get_current_device_type()
----- Original Message -----
From: "Robert Marshall" rmarshall@redhat.com To: anaconda-patches@lists.fedorahosted.org Sent: Wednesday, May 6, 2015 11:43:13 AM Subject: [RHEL 7.2 | PATCH] Disable Label Entry for PPC PReP Boot Filesystem (#1172773)
The manual partitioning window in the installer allowed users to type in and attempt to set a label on PPC PReP Boot filesystems. This would cause the installer to register an error and go back to the previous settings. Updated the behavior to automatically clear the label if the PPC PReP Boot filesystem type is chosen and disabled the label entry field to prevent users from being able to enter information that is invalid for this filesystem type. This fix will also do the same for any other filesystem format that does not support labels.
Resolves rhbz#1172773
pyanaconda/ui/gui/spokes/custom.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 77f3414..0644cc6 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -1389,7 +1389,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): self._labelEntry.set_text(device.format.label) else: self._labelEntry.set_text("")
fancy_set_sensitive(self._labelEntry, True)
# Only Allow Labels on Filesystems Supporting It
if device.format.labeling():
fancy_set_sensitive(self._labelEntry, True)
else:
fancy_set_sensitive(self._labelEntry, False)
This looks right to me, though I'ld probably shorten it to:
fancy_set_sensitive(self._labelEntry, device.format.labeling())
self._device_size_text = device.size.humanReadable(max_places=2) self._sizeEntry.set_text(self._device_size_text)
@@ -2308,6 +2313,13 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): fmt = getFormat(new_type) fancy_set_sensitive(self._mountPointEntry, fmt.mountable)
# Only Allow Labels on Filesystems Supporting It
if fmt.labeling():
fancy_set_sensitive(self._labelEntry, True)
else:
fancy_set_sensitive(self._labelEntry, False)
self._labelEntry.set_text("")
I believe that this is correct for RHEL7.
But this becomes trickier in master, because there is one format that can label and where a label is assigned to that format object when it is created if no label is specified. So, the question is, should that label be displayed in the _labelEntry field?
see: https://github.com/rhinstaller/anaconda/pull/33 for the _long_ discussion.
Assuming this patch is also for master, those considerations will probably complicate this bottom chunk a bit on master.
def _populate_container(self, device=None): """ Set up the vg widgets for lvm or hide them for other types. """ device_type = self._get_current_device_type()
-- 1.8.3.1
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
So, ACK on this patch, but for RHEL7 only.
- mulhern
anaconda-patches@lists.fedorahosted.org