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

skvidal at osuosl.org skvidal at osuosl.org
Tue Jul 20 18:39:36 UTC 2010


 yum/repos.py   |    6 +++++-
 yum/yumRepo.py |    1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit e589f437dcbd1486212d9da2f1bb146c73c45ef2
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Jul 20 13:47:12 2010 -0400

    fix for https://bugzilla.redhat.com/show_bug.cgi?id=613399 in two ways - so that various api callers get
    
    the benefit no matter which objects they are using.
    
    If we have a mediaid and no mediafunc and no other urls to use - then mark the repo as 'skip_if_unavailable' and 'disabled'
    Then if we get any repo obj back from repo.setup() as not enabled then mark it as disabled in the repos object - this is
    mostly so our plugins don't accidentally trample all over it.

diff --git a/yum/repos.py b/yum/repos.py
index 7e9c417..4b74ac6 100644
--- a/yum/repos.py
+++ b/yum/repos.py
@@ -78,7 +78,11 @@ class RepoStorage:
         for repo in repos:
             repo.setup(self.ayum.conf.cache, self.ayum.mediagrabber,
                    gpg_import_func = self.gpg_import_func, confirm_func=self.confirm_func)
-
+            # if we come back from setup NOT enabled then mark as disabled
+            # so nothing else touches us
+            if not repo.enabled:
+                self.disableRepo(repo.id)
+                
         self._setup = True
         self.ayum.plugins.run('postreposetup')
         
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
index ac6c7c0..dd595f0 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -955,6 +955,7 @@ class YumRepository(Repository, config.RepoConf):
         if not self.mediafunc and self.mediaid and not self.mirrorlist and not self.baseurl:
             verbose_logger.log(logginglevels.DEBUG_2, "Disabling media repo for non-media-aware frontend")
             self.enabled = False
+            self.skip_if_unavailable = True
 
     def _cachingRepoXML(self, local):
         """ Should we cache the current repomd.xml """


More information about the Yum-commits mailing list