From bc84cbeee6918bb940e5a0c1b2f70f947525ef70 Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Mon, 20 Aug 2012 14:01:03 -0400 Subject: Only devices that already exist may be ISO install sources (#849482). --- pyanaconda/image.py | 2 +- pyanaconda/ui/gui/spokes/source.py | 45 ++++++++++++++++++++------------------ 2 files changed, 25 insertions(+), 22 deletions(-) (limited to 'pyanaconda') 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) -- cgit