[rhinstaller/blivet/pulls/162 master] Enforce and document the fact that StorageDevice.format is always a DeviceFormat.
vpodzime
installerbot-noreply at redhat.com
Fri Jun 19 07:12:46 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.
Should this talk about **setter** rather than **getter**? If not, I'm a bit confused here.
--
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/162#discussion_r32805959
More information about the anaconda-patches
mailing list