[Yum-devel] [PATCH 2/2] Warn about mis-spelling setopt stuff.
seth vidal
skvidal at fedoraproject.org
Tue Nov 9 19:36:00 UTC 2010
On Tue, 2010-11-09 at 14:32 -0500, James Antill wrote:
> ---
> cli.py | 3 +++
> yum/__init__.py | 3 +++
> 2 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/cli.py b/cli.py
> index b84183b..b01a1ef 100644
> --- a/cli.py
> +++ b/cli.py
> @@ -230,6 +230,9 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
> # now set all the non-first-start opts from main from our setopts
> if self.main_setopts:
> for opt in self.main_setopts.items:
> + if not hasattr(self.conf, opt):
> + msg ="Main config did not have a %s attr. before setopt"
> + self.logger.warning(msg % opt)
> setattr(self.conf, opt, getattr(self.main_setopts, opt))
>
> except yum.Errors.ConfigError, e:
> diff --git a/yum/__init__.py b/yum/__init__.py
> index a588dc8..cfb60b3 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -418,6 +418,9 @@ class YumBase(depsolve.Depsolve):
>
> if thisrepo.id in self.repo_setopts:
> for opt in self.repo_setopts[thisrepo.id].items:
> + if not hasattr(thisrepo, opt):
> + msg = "Repo %s did not have a %s attr. before setopt"
> + self.logger.warning(msg % (thisrepo.id, opt))
> setattr(thisrepo, opt, getattr(self.repo_setopts[thisrepo.id], opt))
>
> if validate and not validate(thisrepo):
ACK
-sv
More information about the Yum-devel
mailing list