[RHEL 7.2 - PATCH] Disable Label Entry for PPC PReP Boot Filesystem (#1172773)

David Lehman dlehman at redhat.com
Fri May 1 20:33:03 UTC 2015


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


More information about the anaconda-patches mailing list