dpolovinkin / rpms / anaconda

Forked from rpms/anaconda 3 years ago
Clone

Blame SOURCES/anaconda-centos-disable-mirrors.patch

95c740
diff -uNrp anaconda-21.48.22.121.orig/pyanaconda/packaging/yumpayload.py anaconda-21.48.22.121/pyanaconda/packaging/yumpayload.py
95c740
--- anaconda-21.48.22.121.orig/pyananconda/packaging/yumpayload.py      2017-08-31 16:28:06.672265889 +0000
95c740
+++ anaconda-21.48.22.121/pyanaconda/packaging/yumpayload.py    2017-08-31 16:28:38.812826778 +0000
95c740
@@ -41,6 +41,7 @@ import sys
95c740
 import time
95c740
 import hashlib
95c740
 from pyanaconda.iutil import execReadlines, ipmi_abort
95c740
+from pyanaconda.product import productName
95c740
 from pyanaconda.simpleconfig import simple_replace
95c740
 from functools import wraps
95c740
 from urlgrabber.grabber import URLGrabber, URLGrabError
95c740
@@ -519,12 +519,16 @@ reposdir=%s
33c795
     @property
33c795
     def mirrorEnabled(self):
33c795
         with _yum_lock:
95c740
-            # yum initializes with plugins disabled, and when plugins are disabled
95c740
-            # _yum.plugins is a DummyYumPlugins object, which has no useful attributes.
95c740
-            if hasattr(self._yum.plugins, "_plugins"):
95c740
-                return "fastestmirror" in self._yum.plugins._plugins
95c740
+            # we just skip this on CentOS since we cant support it yet
33c795
+            if productName.startswith("CentOS"):
95c740
+              return False
95c740
             else:
95c740
-                return False
95c740
+              # yum initializes with plugins disabled, and when plugins are disabled
95c740
+              # _yum.plugins is a DummyYumPlugins object, which has no useful attributes.
95c740
+              if hasattr(self._yum.plugins, "_plugins"):
95c740
+                  return "fastestmirror" in self._yum.plugins._plugins
95c740
+              else:
95c740
+                  return False
95c740
33c795
     def getRepo(self, repo_id):
95c740
         """Return the yum repo object."""