[Yum-devel] [PATCH] Catch and ignore any repo. errors, and allow cache only (BZ 524454)
James Antill
james at and.org
Mon Sep 21 06:06:39 UTC 2009
---
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']
--
1.6.2.5
More information about the Yum-devel
mailing list