[rhel7-branch][PATCH 3/3] Make anaconda check for whether there are any LDL DASDs (#1170653)
Samantha N. Bueno
sbueno+anaconda at redhat.com
Thu Jun 18 16:15:41 UTC 2015
Use the newly created isys.isLdlDASD() to generate a list of LDL DASDs
from those selected, and display the dasdfmt dialog to the user, giving
them the option of reformatting them CDL.
And to anyone wondering why we show the dasdfmt dialog twice (once for
unformatted, once for LDL), it is to give users the option of formatting
unformatted DASDs but not LDL (or vice versa).
Resolves: rhbz#1170653
---
pyanaconda/ui/gui/spokes/storage.py | 18 ++++++++++++++++++
pyanaconda/ui/tui/spokes/storage.py | 16 ++++++++++++----
2 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index fc65a0f..2f2c0fb 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -756,6 +756,24 @@ class StorageSpoke(NormalSpoke, StorageChecker):
# NOTE: rc == 2 means the user clicked on the link that takes t
# back to the hub.
return
+ ldldasds = [d for d in self.selected_disks if isys.isLdlDasd(d)]
+ if len(ldldasds) > 0:
+ dialog = DasdFormatDialog(self.data, self.storage, ldldasds)
+ ignoreEscape(dialog.window)
+ rc = self.run_lightbox_dialog(dialog)
+ if rc == 1:
+ # User hit OK on the dialog
+ self.refresh()
+ elif rc == 2:
+ # User clicked uri to return to hub.
+ NormalSpoke.on_back_clicked(self, button)
+ return
+ elif rc != 2:
+ # User either hit cancel on the dialog or closed it via escape,
+ # there was no formatting done.
+ # NOTE: rc == 2 means the user clicked on the link that takes t
+ # back to the hub.
+ return
# Figure out if the existing disk labels will work on this platform
# you need to have at least one of the platform's labels in order for
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
index 2df64ed..d48e626 100644
--- a/pyanaconda/ui/tui/spokes/storage.py
+++ b/pyanaconda/ui/tui/spokes/storage.py
@@ -34,6 +34,7 @@ from blivet.size import Size
from blivet.errors import StorageError, DasdFormatError
from blivet.devices import DASDDevice, FcoeDiskDevice, iScsiDiskDevice, MultipathDevice, ZFCPDiskDevice
from blivet.devicelibs.dasd import format_dasd, make_unformatted_dasd_list
+from pyanaconda import isys
from pyanaconda.flags import flags
from pyanaconda.kickstart import doKickstartStorage, resetCustomStorageData
from pyanaconda.threads import threadMgr, AnacondaThread
@@ -274,9 +275,13 @@ class StorageSpoke(NormalTUISpoke):
# if we're on s390x, since they need to be formatted before we
# can use them.
if arch.isS390():
- to_format = make_unformatted_dasd_list(self.selected_disks)
- if to_format:
- self.run_dasdfmt(to_format)
+ unformatted = make_unformatted_dasd_list(self.selected_disks)
+ ldl = [d for d in self.selected_disks if isys.isLdlDasd(d)]
+ if unformatted:
+ self.run_dasdfmt(unformatted)
+ return None
+ if ldl:
+ self.run_dasdfmt(ldl)
return None
newspoke = AutoPartSpoke(self.app, self.data, self.storage,
@@ -302,7 +307,10 @@ class StorageSpoke(NormalTUISpoke):
# ask user to verify they want to format if zerombr not in ks file
if not self.data.zerombr.zerombr:
# prepare our msg strings; copied directly from dasdfmt.glade
- summary = _("The following unformatted DASDs have been detected on your system. You can choose to format them now with dasdfmt or cancel to leave them unformatted. Unformatted DASDs can not be used during installation.\n\n")
+ summary = _("The following unformatted or LDL DASDs have been "
+ "detected on your system. You can choose to format them "
+ "now with dasdfmt or cancel to leave them unformatted. "
+ "Unformatted or LDL DASDs can not be used during installation.\n\n")
warntext = _("Warning: All storage changes made using the installer will be lost when you choose to format.\n\nProceed to run dasdfmt?\n")
--
2.4.0
More information about the anaconda-patches
mailing list