[Yum-devel] [PATCH] output the variable name you're attempting to set when we encounter an option error
James Antill
james at fedoraproject.org
Thu Dec 10 16:55:49 UTC 2009
On Thu, 2009-12-10 at 11:07 -0500, Seth Vidal wrote:
> ---
> 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))
ACK.
More information about the Yum-devel
mailing list