[yum-commits] Branch 'yum-3_2_X' - yum/config.py

skvidal at osuosl.org skvidal at osuosl.org
Thu Dec 10 17:05:59 UTC 2009


 yum/config.py |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 3c69171d815bc1e4d50d442549b244bd7c471630
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Thu Dec 10 11:07:02 2009 -0500

    output the variable name you're attempting to set when we encounter an option error

diff --git a/yum/config.py b/yum/config.py
index f31a8f5..f1e8b48 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -92,8 +92,8 @@ class Option(object):
                 value = self.parse(value)
             except ValueError, e:
                 # Add the field name onto the error
-                raise ValueError('Error parsing %r: %s' % (value, str(e)))
-
+                raise ValueError('Error parsing "%s = %r": %s' % (self._optname,
+                                                                 value, str(e)))
         setattr(obj, self._attrname, value)
 
     def setup(self, obj, name):
@@ -103,6 +103,7 @@ class Option(object):
         @param obj: BaseConfig (or subclass) instance.
         @param name: Name of the option.
         '''
+        self._optname = name
         setattr(obj, self._attrname, copy.copy(self.default))
 
     def clone(self):


More information about the Yum-commits mailing list