[yum-commits] yum/config.py

James Antill james at osuosl.org
Thu Aug 30 14:31:43 UTC 2012


 yum/config.py |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit fe37355a6f15183aecf39c315a1c0f9c8e82cf98
Author: James Antill <james at and.org>
Date:   Thu Aug 30 10:29:47 2012 -0400

    Don't fail repo.ui_id if repofile is None, or the open/read/parse fails.

diff --git a/yum/config.py b/yum/config.py
index b81020f..74be397 100644
--- a/yum/config.py
+++ b/yum/config.py
@@ -1173,7 +1173,14 @@ def _readRawRepoFile(repo):
     if not _use_iniparse:
         return None
 
-    ini = INIConfig(open(repo.repofile))
+    if not hasattr(repo, 'repofile') or not repo.repofile:
+        return None
+
+    try:
+        ini = INIConfig(open(repo.repofile))
+    except:
+        return None
+
     # b/c repoids can have $values in them we need to map both ways to figure
     # out which one is which
     section_id = repo.id


More information about the Yum-commits mailing list