[yum-commits] completion-helper.py

zpavlas at osuosl.org zpavlas at osuosl.org
Mon Oct 1 08:29:38 UTC 2012


 completion-helper.py |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2308c343d9d49811982bffd7b9cc0d602e1a0e5e
Author: Zdeněk Pavlas <zpavlas at redhat.com>
Date:   Mon Oct 1 10:24:43 2012 +0200

    completion helper: Handle ConfigError.  BZ 861264.
    
    No traceback on malformed .repo files.

diff --git a/completion-helper.py b/completion-helper.py
index 0e4b96b..05801d1 100755
--- a/completion-helper.py
+++ b/completion-helper.py
@@ -23,7 +23,7 @@ import sys
 
 import cli
 import yumcommands
-from yum.Errors import GroupsError
+from yum.Errors import GroupsError, ConfigError
 
 
 class GroupsCompletionCommand(yumcommands.GroupsCommand):
@@ -76,11 +76,11 @@ def main(args):
     base.registerCommand(RepoListCompletionCommand())
     base.getOptionsConfig(args)
     base.parseCommands()
-    for repo in base.repos.listEnabled():
-        repo.skip_if_unavailable = True
     try:
+        for repo in base.repos.listEnabled():
+            repo.skip_if_unavailable = True
         base.doCommands()
-    except GroupsError, e:
+    except (GroupsError, ConfigError), e:
         base.logger.error(e)
 
 if __name__ == "__main__":


More information about the Yum-commits mailing list