yifengyou / rpms / yum

Forked from rpms/yum 3 years ago
Clone

Blame SOURCES/BZ-1377328-_metadata_cache_req.patch

5e9bef
commit 673ceee5f3d32fc6397e9a280ac18926e82ac152
5e9bef
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
5e9bef
Date:   Mon Sep 19 17:38:08 2016 +0200
5e9bef
5e9bef
    Check for _metadata_cache_req properly.
5e9bef
5e9bef
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
5e9bef
index 2db8faf..47f950b 100644
5e9bef
--- a/yum/yumRepo.py
5e9bef
+++ b/yum/yumRepo.py
5e9bef
@@ -1473,7 +1473,8 @@ 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
+                    if (self.skip_if_unavailable and hasattr(self, '_metadata_cache_req')
5e9bef
+                        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