[rhinstaller/blivet/pulls/162 master] Enforce and document the fact that StorageDevice.format is always a DeviceFormat.

dwlehman installerbot-noreply at redhat.com
Wed Jun 24 14:23:35 UTC 2015


> @@ -592,9 +592,29 @@ def status(self):
>          return os.access(self.path, os.W_OK)
>  
>      def _setFormat(self, fmt):
> -        """ Set the Device's format. """
> +        """ Set the Device's format.
> +
> +            :param fmt: the new format or None
> +            :type fmt: :class:`~.formats.DeviceFormat` or NoneType
> +
> +            A value of None will effectively mark the device as unformatted,
> +            but this is accomplished by setting it to an instance of the base
> +            :class:`~.formats.DeviceFormat` class.
> +
> +            .. note::
> +                :attr:`format` should always be an instance of
> +                :class:`~.formats.DeviceFormat`. To ensure this continues to be
> +                the case, all subclasses that define their own :attr:`format`
> +                getter should call :meth:`StorageDevice._setFormat` from their
> +                getter.

Indeed it should. Thanks.

-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/162#discussion_r33152002


More information about the anaconda-patches mailing list