[blivet:master 1/3] Update minSize method headers.

David Lehman dlehman at redhat.com
Fri Oct 31 19:31:58 UTC 2014


On 10/31/2014 10:31 AM, mulhern wrote:
> minSize values are no longer in megabytes and it can be None,
> due to its dependence on _minInstanceSize.
>
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
>   blivet/formats/__init__.py | 10 +++++++++-
>   blivet/formats/fs.py       |  2 --
>   2 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/blivet/formats/__init__.py b/blivet/formats/__init__.py
> index 4867f9c..d18c230 100644
> --- a/blivet/formats/__init__.py
> +++ b/blivet/formats/__init__.py
> @@ -484,7 +484,15 @@ class DeviceFormat(ObjectID):
>
>       @property
>       def minSize(self):
> -        """ Minimum size for this format type. """
> +        """ Minimum size for this format type.
> +
> +            :rtype: :class:`~.size.Size` or NoneType
> +
> +            Note that typically minSize is a Size because for most formats
> +            the value is dependent solely on the type of the format.
> +            For filesystems, however, the minimum size depends on a
> +            particular instance and so may be None if unfound.
> +        """
>           return self._minSize
>
>       @property

minSize should never be None. Instead of documenting it we should be 
changing the initial value of FS._minInstanceSize to Size(0). That is 
definitely not intended and should have been changed when we stopped 
automatically gathering fs usage info outside of installer_mode.

David

> diff --git a/blivet/formats/fs.py b/blivet/formats/fs.py
> index ad9bf98..1bd3b93 100644
> --- a/blivet/formats/fs.py
> +++ b/blivet/formats/fs.py
> @@ -1379,7 +1379,6 @@ class NTFS(FS):
>
>       @property
>       def minSize(self):
> -        """ The minimum filesystem size. """
>           return self._minInstanceSize
>
>       @property
> @@ -1588,7 +1587,6 @@ class TmpFS(NoDevFS):
>
>       @property
>       def minSize(self):
> -        """ The minimum filesystem size in megabytes. """
>           return self._minInstanceSize
>
>       @property
>



More information about the anaconda-patches mailing list