[blivet:rhel7/master 1/3] Changes to the handling of filesystem labeling (#1038590)

Brian C. Lane bcl at redhat.com
Sat Dec 21 01:07:07 UTC 2013


On Fri, Dec 20, 2013 at 06:12:51PM -0500, mulhern wrote:

> @@ -682,8 +747,11 @@ class FS(DeviceFormat):
>  
>      @property
>      def labelfsProg(self):
> -        """ Program used to manage labels for this filesystem type. """
> -        return self._labelfs
> +        """ Program used to manage labels for this filesystem type.
> +
> +            May be None if no such program exists.
> +        """
> +        return self._labelfs.name if self._labelfs else None

We avoid the inline if/else construct for readability. The same goes for
the x = one or another style, for the most part.

> diff --git a/blivet/formats/fslabel.py b/blivet/formats/fslabel.py
> new file mode 100644
> index 0000000..452bc78
> --- /dev/null
> +++ b/blivet/formats/fslabel.py
> @@ -0,0 +1,216 @@
> +# fslabel.py
> +# Filesystem labelling classes for anaconda's storage configuration module.
> +#
> +# Copyright (C) 2009  Red Hat, Inc.

2013

> +class E2Label(FSLabelApp):
> +    """Application used by ext2 and its descendants."""
> +
> +    _name = "e2label"
> +
> +    def reads(self):
> +        return True

The subclass property needs @property otherwise it is just a method.

Ack, other than those comments.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list