[PATCH 23/47] There is no more parted.error, so just use Exception.

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

 



From: Chris Lumens <clumens@xxxxxxxxxx>

I kind of hate having to do this since Exception is so broad but it's the
fastest way to get past this and on to the real bugs.  We need to go back
and add more fine-grained error handling later though.
---
 autopart.py    |    4 ++--
 partedUtils.py |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/autopart.py b/autopart.py
index 491eb5f..2e0f7dd 100644
--- a/autopart.py
+++ b/autopart.py
@@ -271,7 +271,7 @@ def fitConstrained(diskset, requests, primOnly=0, newParts = None):
             try:
                 disk.add_partition (newp, constraint)
 
-            except parted.error, msg:
+            except Exception, msg:
                 raise PartitioningError, str(msg)
             for flag in request.fstype.getPartedPartitionFlags():
                 if not newp.is_flag_available(flag):
@@ -474,7 +474,7 @@ def fitSized(diskset, requests, primOnly = 0, newParts = None):
 
             try:
                 disk.add_partition (newp, constraint)
-            except parted.error, msg:
+            except Exception, msg:
                 raise PartitioningError, str(msg)
             for flag in request.fstype.getPartedPartitionFlags():
                 if not newp.is_flag_available(flag):
diff --git a/partedUtils.py b/partedUtils.py
index fe4bcea..d29ef46 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -956,7 +956,7 @@ class DiskSet:
                     disk = parted.Disk(device=dev)
                 else:
                     disk = labelDisk(deviceFile)
-            except parted.error, msg:
+            except Exception, msg:
                 log.error("parted error: %s" % (msg,))
                 raise
         except:
@@ -1043,7 +1043,7 @@ class DiskSet:
                 if not dev:
                     dev = parted.getDevice("/dev/%s" % (drive,))
                     disk = None
-            except parted.error, msg:
+            except Exception, msg:
                 log.debug("parted error: %s" % (msg,))
                 self._removeDisk(drive, disk)
                 continue
@@ -1052,7 +1052,7 @@ class DiskSet:
                 if not disk:
                     disk = parted.Disk(device=dev)
                     self._addDisk(drive, disk)
-            except parted.error, msg:
+            except Exception, msg:
                 recreate = 0
                 if zeroMbr:
                     log.error("zeroMBR was set and invalid partition table "
-- 
1.6.1.3

_______________________________________________
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