[blivet:rhel7/master] Set device.format.label field close to where we read it (#1056139)

Vratislav Podzimek vpodzime at redhat.com
Wed Jan 22 08:31:32 UTC 2014


On Tue, 2014-01-21 at 12:07 -0500, mulhern wrote:
> Resolves: rhbz#1056139
> 
> Previously, somewhere between where this was set and where it was first read
> in _populate_right_side it was occasionally being reset to None. This
> should have been impossible as the code between is very simple and it should
> be impossible for it to have this side-effect. Nonetheless, it was observed
> to happen.
> 
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
>  pyanaconda/ui/gui/spokes/custom.py | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
> index b6bbf7c..82e020f 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -1693,9 +1693,6 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
>          else:
>              use_dev = device
>  
> -        if hasattr(device.format, "label") and device.format.label is None:
> -            device.format.label = ""
> -
>          if hasattr(use_dev, "req_disks") and not use_dev.exists:
>              self._device_disks = use_dev.req_disks[:]
>          else:
> @@ -1734,7 +1731,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
>          self._mountPointEntry.set_text(getattr(device.format, "mountpoint", "") or "")
>          fancy_set_sensitive(self._mountPointEntry, device.format.mountable)
>  
> -        self._labelEntry.set_text(getattr(device.format, "label", ""))
> +        if hasattr(device.format, "label"):
> +            if device.format.label is None:
> +                device.format.label = ""
> +            self._labelEntry.set_text(device.format.label)
> +        else:
> +            self._labelEntry.set_text("")
>          fancy_set_sensitive(self._labelEntry, not device.format.exists)
Looks good to me, thanks! Just out of curiosity -- if device.format
doesn't have the 'label' attribute, does it make sense to just set
labelEntry to "" or should it be made insensitive?

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list