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

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