Since device id's do not always map to device names as expected (e.g. dasda -> 0.0.0200, dasdb -> 0.0.0201, etc.), include the device id on the dasdfmt screen so that it's clear which devices are going to be formatted.
This required a couple of changes to the storage spoke as well since we were only passing a list of device names to the dasdfmt dialog; now it passes a list of DASDDevice objects, so the dasdfmt dialog can access the device id attr.
See: https://sbueno.fedorapeople.org/1269174.png (Although, only one space between devname and devid, not two.)
Resolves: rhbz#1269174 --- pyanaconda/ui/gui/spokes/lib/dasdfmt.py | 6 +++--- pyanaconda/ui/gui/spokes/storage.py | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/lib/dasdfmt.py b/pyanaconda/ui/gui/spokes/lib/dasdfmt.py index e1d3df2..6f31570 100644 --- a/pyanaconda/ui/gui/spokes/lib/dasdfmt.py +++ b/pyanaconda/ui/gui/spokes/lib/dasdfmt.py @@ -56,7 +56,7 @@ class DasdFormatDialog(GUIObject): self._hub_label = self.builder.get_object("returnToHubLabel1")
if len(self.to_format) > 0: - self._unformatted_label.set_text("\n".join("/dev/" + d for d in to_format)) + self._unformatted_label.set_text("\n".join("/dev/" + d.name + " (" + d.busid + ")" for d in to_format)) else: self._unformatted_label.set_text("")
@@ -90,8 +90,8 @@ class DasdFormatDialog(GUIObject): """ Loop through our disks and run dasdfmt against them. """ for disk in self.to_format: try: - gtk_call_once(self._formatting_label.set_text, _("Formatting /dev/%s. This may take a moment.") % disk) - format_dasd(disk) + gtk_call_once(self._formatting_label.set_text, _("Formatting /dev/%s. This may take a moment.") % disk.name) + format_dasd(disk.name) except DasdFormatError as err: # Log errors if formatting fails, but don't halt the installer log.error(str(err)) diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index c6751fb..4e3eb81 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -839,10 +839,13 @@ class StorageSpoke(NormalSpoke, StorageChecker): # check for unformatted DASDs and launch dasdfmt if any discovered dasds = make_unformatted_dasd_list(self.selected_disks) if len(dasds) > 0: + # need to get a list of DASDDevice objects, so.... + dasdobjs = [self.storage.devicetree.getDeviceByName(d) for d in dasds] + # We want to apply current selection before running dasdfmt to # prevent this information from being lost afterward applyDiskSelection(self.storage, self.data, self.selected_disks) - dialog = DasdFormatDialog(self.data, self.storage, dasds) + dialog = DasdFormatDialog(self.data, self.storage, dasdobjs) ignoreEscape(dialog.window) rc = self.run_lightbox_dialog(dialog) if rc == 1: @@ -860,7 +863,7 @@ class StorageSpoke(NormalSpoke, StorageChecker): return
# check for ldl dasds - ldldasds = [d.name for d in self.storage.devicetree.dasd if is_ldl_dasd(d.name)] + ldldasds = [d for d in self.storage.devicetree.dasd if is_ldl_dasd(d.name)] if len(ldldasds) > 0: dialog = DasdFormatDialog(self.data, self.storage, ldldasds) ignoreEscape(dialog.window)
On Fri, Feb 26, 2016 at 02:40:13PM -0500, Samantha N. Bueno wrote:
Since device id's do not always map to device names as expected (e.g. dasda -> 0.0.0200, dasdb -> 0.0.0201, etc.), include the device id on the dasdfmt screen so that it's clear which devices are going to be formatted.
This required a couple of changes to the storage spoke as well since we were only passing a list of device names to the dasdfmt dialog; now it passes a list of DASDDevice objects, so the dasdfmt dialog can access the device id attr.
See: https://sbueno.fedorapeople.org/1269174.png (Although, only one space between devname and devid, not two.)
Resolves: rhbz#1269174
Ack.
anaconda-patches@lists.fedorahosted.org