[Yum-devel] [PATCH] output the variable name you're attempting to set when we encounter an option error

Seth Vidal skvidal at fedoraproject.org
Thu Dec 10 16:07:43 UTC 2009


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

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):
-- 
1.6.5.2



More information about the Yum-devel mailing list