[master/rhel7 1/2] Fix fastestmirror plugin check (#876135)

Brian C. Lane bcl at redhat.com
Wed Sep 4 00:55:17 UTC 2013


From: "Brian C. Lane" <bcl at redhat.com>

It ends up enabledPlugins is just the list we gave yum to load, it
doesn't reflect success or failure. If a plugin is actually loaded it is
added to the internal dict plugins._plugins

Related: rhbz#876135
---
 pyanaconda/packaging/yumpayload.py |  2 +-
 pyanaconda/ui/gui/spokes/source.py | 11 +++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 3ce95d1..4926e96 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -420,7 +420,7 @@ reposdir=%s
     @property
     def mirrorEnabled(self):
         with _yum_lock:
-            return "fastestmirror" in self._yum.plugins.enabledPlugins
+            return "fastestmirror" in self._yum.plugins._plugins
 
     def getRepo(self, repo_id):
         """ Return the yum repo object. """
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index e49f163..8dd8ba2 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -641,10 +641,13 @@ class SourceSpoke(NormalSpoke):
             combo = self.builder.get_object("isoPartitionCombo")
             combo.set_active(active)
 
-        # We default to the mirror list, and then if the method tells us
-        # something different later, we can change it.
-        self._protocolComboBox.set_active(PROTOCOL_MIRROR)
-        self._urlEntry.set_sensitive(False)
+        # We default to the mirror list if available. http otherwise
+        if self.payload.mirrorEnabled:
+            self._protocolComboBox.set_active(PROTOCOL_MIRROR)
+            self._urlEntry.set_sensitive(False)
+        else:
+            self._protocolComboBox.set_active(PROTOCOL_HTTP)
+            self._urlEntry.set_sensitive(True)
 
         # Set up the default state of UI elements.
         if self.data.method.method == "url":
-- 
1.8.3.1



More information about the anaconda-patches mailing list