Blame SOURCES/BZ-1183669-corrupt-cache.patch

eb5f31
commit fb107337b2490d314a4f31562427cdebe9eca4e4
eb5f31
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
eb5f31
Date:   Thu Mar 17 16:35:29 2016 +0100
eb5f31
eb5f31
    Disable repo with skip_if_unavailable=True if repomd.xml can't be retrieved.
eb5f31
eb5f31
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
eb5f31
index fc5d538..3f7e975 100644
eb5f31
--- a/yum/yumRepo.py
eb5f31
+++ b/yum/yumRepo.py
eb5f31
@@ -1460,6 +1460,10 @@ Insufficient space in download directory %s
eb5f31
             else:
eb5f31
                 result = self._getFileRepoXML(local, text)
eb5f31
                 if result is None:
eb5f31
+                    if self.skip_if_unavailable and self._metadata_cache_req in ('write', 'read-only:future'):
eb5f31
+                        # Since skip_if_unavailable=True, we can just disable this repo
eb5f31
+                        raise Errors.RepoError, "Can't download repomd.xml for %s" % self.ui_id
eb5f31
+
eb5f31
                     # Ignore this as we have a copy
eb5f31
                     self._revertOldRepoXML()
eb5f31
                     return False