[blivet:rhel7/master 10/10] Move label setter and getter into DeviceFormat class (#1038590)

David Lehman dlehman at redhat.com
Fri Jan 10 15:10:04 UTC 2014


On Thu, 2014-01-09 at 13:55 -0500, mulhern wrote:
> Related: rhbz#1038590
> 
> DeviceFormat does not have a label but SwapSpace as well as FS does, and
> it is better to put the same restrictions on the label for both.
> Note that the restriction has been reduced to converting "" to None.
> The comments on the setter explain why it is not possible to be more
> restrictive.
> 
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
>  blivet/formats/__init__.py | 38 ++++++++++++++++++++++++++++++++++++++
>  blivet/formats/fs.py       | 45 ++-------------------------------------------
>  blivet/formats/swap.py     |  3 +++
>  3 files changed, 43 insertions(+), 43 deletions(-)
<snip>
> diff --git a/blivet/formats/swap.py b/blivet/formats/swap.py
> index d7c948e..29b608a 100644
> --- a/blivet/formats/swap.py
> +++ b/blivet/formats/swap.py
> @@ -88,6 +88,9 @@ class SwapSpace(DeviceFormat):
>          """Returns True since no known restrictions on the label."""
>          return True
>  
> +    label = property(lambda s: s._getLabel(), lambda s,l: s._setLabel(l),
> +       doc="this filesystem's label")

Swap is not a filesystem. Otherwise, looks good.

> +
>      def _setPriority(self, priority):
>          if priority is None:
>              self._priority = None




More information about the anaconda-patches mailing list