summaryrefslogtreecommitdiffstats
path: root/partedUtils.py
diff options
context:
space:
mode:
authorMark McLoughlin <markmc@redhat.com>2008-09-12 15:58:21 +0100
committerChris Lumens <clumens@redhat.com>2008-09-16 11:42:23 -0400
commit89221306a6d3c405260f0f9b13a9ef687419c6e7 (patch)
tree5b2f1c3ed4fd059005b65df7b042b7468ad15389 /partedUtils.py
parentf61cb81af93e4c4574d73318fc14d2230e61622c (diff)
downloadanaconda-89221306a6d3c405260f0f9b13a9ef687419c6e7.tar.gz
anaconda-89221306a6d3c405260f0f9b13a9ef687419c6e7.tar.xz
anaconda-89221306a6d3c405260f0f9b13a9ef687419c6e7.zip
Fixup DiskSet._askForLabelPermission()
This function seems to have gotten horribly screwed up lately: - We never actually query the user about initialising the partition table; so if you've got an unitialized partition table, there's no way to install - We've create two versions of the message string and use neither - We test for "ks and (drive in clearDevs) and initAll" twice; the second test can never be true, obviously - We test for "not intf" twice, again the second can't be true Patch is untested, but it's clearly an improvement :-) Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Diffstat (limited to 'partedUtils.py')
-rw-r--r--partedUtils.py36
1 files changed, 9 insertions, 27 deletions
diff --git a/partedUtils.py b/partedUtils.py
index 725ccc5b8..17a120830 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -1099,41 +1099,23 @@ class DiskSet:
return False
rc = 0
- if ks and (drive in clearDevs) and initAll:
+ if (ks and (drive in clearDevs) and initAll) or \
+ self.isDisciplineFBA(drive):
rc = 1
- else:
- if not intf:
- self._removeDisk(drive)
- return False
- msg = _("The partition table on device %s was unreadable. "
+ elif intf:
+ deviceFile = "/dev/" + drive
+ dev = parted.PedDevice.get(deviceFile)
+
+ msg = _("The partition table on device %s (%s %-0.f MB) was unreadable.\n"
"To create new partitions it must be initialized, "
"causing the loss of ALL DATA on this drive.\n\n"
"This operation will override any previous "
"installation choices about which drives to "
"ignore.\n\n"
"Would you like to initialize this drive, "
- "erasing ALL DATA?") % (drive,)
+ "erasing ALL DATA?") % (drive, dev.model, getDeviceSizeMB (dev),)
- rc = 0
- if (ks and (drive in clearDevs) and initAll) or \
- self.isDisciplineFBA(drive):
- rc = 1
- else:
- if not intf:
- self._removeDisk(drive)
- return False
-
- deviceFile = "/dev/" + drive
- dev = parted.PedDevice.get(deviceFile)
-
- msg = _("The partition table on device %s (%s %-0.f MB) was unreadable.\n"
- "To create new partitions it must be initialized, "
- "causing the loss of ALL DATA on this drive.\n\n"
- "This operation will override any previous "
- "installation choices about which drives to "
- "ignore.\n\n"
- "Would you like to initialize this drive, "
- "erasing ALL DATA?") % (drive, dev.model, getDeviceSizeMB (dev),)
+ rc = intf.messageWindow(_("Warning"), msg, type="yesno")
if rc != 0:
return True