Blob Blame History Raw
From 2ffe59eb3e441f3fce3038d1c19079cc5c59eb74 Mon Sep 17 00:00:00 2001
From: James Antill <james@and.org>
Date: Mon, 21 Sep 2009 02:05:29 -0400
Subject: [PATCH] Catch and ignore any repo. errors, and allow cache only (BZ 524454)

---
 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