summaryrefslogtreecommitdiffstats
path: root/pyanaconda
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2012-08-20 14:01:03 -0400
committerChris Lumens <clumens@redhat.com>2012-08-21 08:22:59 -0400
commitbc84cbeee6918bb940e5a0c1b2f70f947525ef70 (patch)
tree2428847ac8f82bc0a32a32c5ce8e0fad5bca6f8a /pyanaconda
parent8185a4393dad1e169c02f29c644b6101c596fb96 (diff)
downloadanaconda-bc84cbeee6918bb940e5a0c1b2f70f947525ef70.tar.gz
anaconda-bc84cbeee6918bb940e5a0c1b2f70f947525ef70.tar.xz
anaconda-bc84cbeee6918bb940e5a0c1b2f70f947525ef70.zip
Only devices that already exist may be ISO install sources (#849482).
Diffstat (limited to 'pyanaconda')
-rw-r--r--pyanaconda/image.py2
-rw-r--r--pyanaconda/ui/gui/spokes/source.py45
2 files changed, 25 insertions, 22 deletions
diff --git a/pyanaconda/image.py b/pyanaconda/image.py
index 009e38ae2..6f8cc5f39 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.format.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 fd40b5cb3..b9f544ca2 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)