[blivet-rhel7/f20/master] Make error message in setDefaultFSType more informative (#1019766)

mulhern amulhern at redhat.com
Mon Dec 2 19:14:16 UTC 2013


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
 
-- 
1.8.3.1



More information about the anaconda-patches mailing list