From: "Brian C. Lane" <bcl(a)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
(cherry picked from commit 27f8127b53a4a50e83268bd76281f4ac8bec71ca)
Resolves: rhbz#1249569
---
pyanaconda/packaging/yumpayload.py | 4 ++--
pyanaconda/ui/gui/spokes/source.py | 12 ++++++++----
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 4c2a837..4d96e9c 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -483,8 +483,8 @@ def mirrorEnabled(self):
with _yum_lock:
# yum initializes with plugins disabled, and when plugins are disabled
# _yum.plugins is a DummyYumPlugins object, which has no useful attributes.
- if hasattr(self._yum.plugins, "enabledPlugins"):
- return "fastestmirror" in self._yum.plugins.enabledPlugins
+ if hasattr(self._yum.plugins, "_plugins"):
+ return "fastestmirror" in self._yum.plugins._plugins
else:
return False
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index 849db83..1d85377 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -772,10 +772,14 @@ def refresh(self):
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_id(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_id(PROTOCOL_MIRROR)
+ self._urlEntry.set_sensitive(False)
+ else:
+ self._protocolComboBox.set_active_id(PROTOCOL_HTTP)
+ self._urlEntry.set_sensitive(True)
+
self._updateURLEntryCheck()
# Set up the default state of UI elements.
--
To view this commit on github, visit
https://github.com/rhinstaller/anaconda/commit/6fe9c2298196ea058be7dc4990...