yifengyou / rpms / yum

Forked from rpms/yum 3 years ago
Clone

Blame SOURCES/BZ-1063177-xml-traceback.patch

5e9bef
commit 6132fa0c489f85c93ce77587ae3db4930d5bb1a4
5e9bef
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
5e9bef
Date:   Tue May 26 11:16:00 2015 +0200
5e9bef
5e9bef
    Don't traceback on xml parsing. BZ#1063177
5e9bef
5e9bef
diff --git a/yum/repos.py b/yum/repos.py
5e9bef
index d5e50ac..a0ef28c 100644
5e9bef
--- a/yum/repos.py
5e9bef
+++ b/yum/repos.py
5e9bef
@@ -381,6 +381,13 @@ class RepoStorage:
5e9bef
             sack = repo.getPackageSack()
5e9bef
             try:
5e9bef
                 sack.populate(repo, mdtype, callback, cacheonly)
5e9bef
+            except TypeError, e:
5e9bef
+                if not e.args[0].startswith('Parsing'):
5e9bef
+                    raise
5e9bef
+                if mdtype in ['all', 'metadata'] and repo.skip_if_unavailable:
5e9bef
+                    self.disableRepo(repo.id)
5e9bef
+                else:
5e9bef
+                    raise Errors.RepoError(e.args[0])
5e9bef
             except Errors.RepoError, e:
5e9bef
                 if mdtype in ['all', 'metadata'] and repo.skip_if_unavailable:
5e9bef
                     self.disableRepo(repo.id)