[yum-commits] Branch 'yum-3_2_X' - yum/yumRepo.py

James Antill james at osuosl.org
Tue Nov 11 19:18:20 UTC 2008


 yum/yumRepo.py |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 18f774ed5c9ec45cc71496380ce47c9fa2335ab0
Author: James Antill <james at and.org>
Date:   Tue Nov 11 14:18:13 2008 -0500

    If anything bad happens with the repomd.xml checking, delete it for safety

diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index 9a24d20..f5356c6 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -1284,6 +1284,20 @@ class YumRepository(Repository, config.RepoConf):
                        fdel=lambda self: setattr(self, "_repoXML", None))
 
     def _checkRepoXML(self, fo):
+        try:
+            self._checkRepoXML_inner(fo)
+        except:
+            #  Unlink the repomd.xml if it didn't pass our checks, really
+            # urlgrabber/whatever should be doing this ... but we do it.
+            #  Also we are screwed if this can ever fail for some reason like
+            # the ZFS quota snafu.
+            try:
+                os.unlink(self.cachedir + '/repomd.xml')
+            except:
+                pass
+            raise
+
+    def _checkRepoXML_inner(self, fo):
         if type(fo) is types.InstanceType:
             filepath = fo.filename
         else:


More information about the Yum-commits mailing list