[Yum-devel] [PATCH] Catch and ignore any repo. errors, and allow cache only (BZ 524454)

Tim Lauridsen tim.lauridsen at googlemail.com
Mon Sep 21 07:24:26 UTC 2009


On 09/21/2009 08:06 AM, James Antill wrote:
> ---
>   yumcommands.py |   10 +++++++---
>   1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/yumcommands.py b/yumcommands.py
> index bd73d0c..3d88ee4 100644
> --- a/yumcommands.py
> +++ b/yumcommands.py
> @@ -778,13 +778,17 @@ class RepoListCommand(YumCommand):
>               arg = 'enabled'
>           extcmds = map(lambda x: x.lower(), extcmds)
>
> -        # Setup so len(repo.sack) is correct
> -        base.repos.populateSack()
> +        verbose = base.verbose_logger.isEnabledFor(logginglevels.DEBUG_3)
> +        try:
> +            # Setup so len(repo.sack) is correct
> +            base.repos.populateSack()
> +        except yum.Errors.RepoError:
> +            if verbose:
> +                raise
>
>           repos = base.repos.repos.values()
>           repos.sort()
>           enabled_repos = base.repos.listEnabled()
> -        verbose = base.verbose_logger.isEnabledFor(logginglevels.DEBUG_3)
>           if arg == 'all':
>               ehibeg = base.term.FG_COLOR['green'] + base.term.MODE['bold']
>               dhibeg = base.term.FG_COLOR['red']

ACK.

Tim


More information about the Yum-devel mailing list