[blivet-rhel7/f20/master] Make error message in setDefaultFSType more informative (#1019766)
Vratislav Podzimek
vpodzime at redhat.com
Tue Dec 3 06:54:16 UTC 2013
On Mon, 2013-12-02 at 14:14 -0500, mulhern wrote:
> Related: rhbz#1019766
>
> This has been observed to raise a ValueError a couple of times. Want to
> make the error message more informative in case it happens again.
>
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
> blivet/__init__.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/blivet/__init__.py b/blivet/__init__.py
> index d3c5a8b..037c9e8 100644
> --- a/blivet/__init__.py
> +++ b/blivet/__init__.py
> @@ -1765,12 +1765,12 @@ class Blivet(object):
> log.debug("trying to set new default fstype to '%s'" % newtype)
> fmt = getFormat(newtype)
> if fmt.type is None:
> - raise ValueError("unrecognized value for new default fs type")
> + raise ValueError("unrecognized value %s for new default fs type" % newtype)
>
> if (not fmt.mountable or not fmt.formattable or not fmt.supported or
> not fmt.linuxNative):
> log.debug("invalid default fstype: %r" % fmt)
> - raise ValueError("new value is not valid as a default fs type")
> + raise ValueError("new value %s is not valid as a default fs type" % fmt)
>
> self._defaultFSType = newtype
Additional info in the exceptions never hurts. :) ACK.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list