[PATCH] A "partition" having no partedPartition shouldn't be a traceback (#519128).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



...when checking the validity of /boot partitions, at least.  This situation
really indicates the user did something weird like encrypt /boot, and those
kinds of problems will already be detected.  We'd rather display the errors
than traceback.
---
 platform.py |   16 +++++++---------
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/platform.py b/platform.py
index 36a2897..122984e 100644
--- a/platform.py
+++ b/platform.py
@@ -255,11 +255,10 @@ class Alpha(Platform):
     def checkBootRequest(self, req):
         errors = Platform.checkBootRequest(self, req)
 
-        disk = req.disk
-        if not disk:
-            raise DeviceError("Boot partition has no disk")
+        if not req or not req.disk:
+            return errors
 
-        disk = disk.format.partedDisk
+        disk = req.disk.format.partedDisk
 
         # Check that we're a BSD disk label
         if not disk.type == self.diskType.name:
@@ -329,7 +328,7 @@ class IPSeriesPPC(PPC):
 
         bootPart = getattr(req, "partedPartition", None)
         if not bootPart:
-            raise DeviceError("Boot partition has no partedPartition")
+            return errors
 
         if bootPart.geometry.end * bootPart.geometry.device.sectorSize / (1024.0 * 1024) > 4096:
             errors.append(_("The boot partition must be within the first 4MB of the disk."))
@@ -387,11 +386,10 @@ class NewWorldPPC(PPC):
     def checkBootRequest(self, req):
         errors = PPC.checkBootRequest(self, req)
 
-        disk = req.disk
-        if not disk:
-            raise DeviceError("Boot partition has no disk")
+        if not disk or not req.disk:
+            return errors
 
-        disk = disk.format.partedDisk
+        disk = req.disk.format.partedDisk
 
         # Check that we're a Mac disk label
         if not disk.type == self.diskType.name:
-- 
1.6.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux