[PATCH] Only devices that already exist may be ISO install sources (#849482).
Chris Lumens
clumens at redhat.com
Mon Aug 20 19:52:06 UTC 2012
---
pyanaconda/image.py | 2 +-
pyanaconda/ui/gui/spokes/source.py | 45 ++++++++++++++++++++------------------
2 files changed, 25 insertions(+), 22 deletions(-)
diff --git a/pyanaconda/image.py b/pyanaconda/image.py
index 009e38a..0bc5c99 100644
--- a/pyanaconda/image.py
+++ b/pyanaconda/image.py
@@ -203,7 +203,7 @@ def opticalInstallMedia(devicetree, mountpoint=INSTALL_TREE):
# Return a list of Device instances that may have HDISO install media
# somewhere. Candidate devices are simply any that we can mount.
def potentialHdisoSources(devicetree):
- return filter(lambda d: d.format.mountable, devicetree.getDevicesByType("partition"))
+ return filter(lambda d: d.exists and d.format.mountable, devicetree.getDevicesByType("partition"))
def umountImage(tree):
if os.path.ismount(tree):
diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
index fd40b5c..b9f544c 100644
--- a/pyanaconda/ui/gui/spokes/source.py
+++ b/pyanaconda/ui/gui/spokes/source.py
@@ -641,27 +641,6 @@ class SourceSpoke(NormalSpoke):
self._autodetectBox.set_no_show_all(False)
self._autodetectButton.set_no_show_all(False)
- # Find all hard drive partitions that could hold an ISO and add each
- # to the diskStore.
- store = self.builder.get_object("partitionStore")
-
- added = False
- active = 0
- idx = 0
- for dev in potentialHdisoSources(self.storage.devicetree):
- store.append([dev, "%s (%s MB)" % (self._sanitize_model(dev.disk.model), int(dev.size))])
- if dev.name == self.data.method.partition:
- active = idx
- added = True
- idx += 1
-
- # Again, only display these widgets if an HDISO source was found.
- if added:
- self._isoBox.set_no_show_all(False)
- self._isoButton.set_no_show_all(False)
- combo = self.builder.get_object("isoPartitionCombo")
- combo.set_active(active)
-
# Add the mirror manager URL in as the default for HTTP and HTTPS.
# We'll override this later in the refresh() method, if they've already
# provided a URL.
@@ -673,6 +652,30 @@ class SourceSpoke(NormalSpoke):
def refresh(self):
NormalSpoke.refresh(self)
+ # Find all hard drive partitions that could hold an ISO and add each
+ # to the partitionStore. This has to be done here because if the user
+ # has done partitioning first, they may have blown away partitions
+ # found during _initialize on the partitioning spoke.
+ store = self.builder.get_object("partitionStore")
+ store.clear()
+
+ added = False
+ active = 0
+ idx = 0
+ for dev in potentialHdisoSources(self.storage.devicetree):
+ store.append([dev, "%s (%s MB)" % (self._sanitize_model(dev.disk.model), int(dev.size))])
+ if dev.name == self.data.method.partition:
+ active = idx
+ added = True
+ idx += 1
+
+ # Again, only display these widgets if an HDISO source was found.
+ if added:
+ self._isoBox.set_no_show_all(False)
+ self._isoButton.set_no_show_all(False)
+ 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(0)
--
1.7.11.2
More information about the anaconda-patches
mailing list