[PATCH 4/5] Create and use DiskLabelCommitError for failure to commit.

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

 



---
 storage/errors.py            |    3 +++
 storage/formats/disklabel.py |    4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/storage/errors.py b/storage/errors.py
index d9fe4c8..802806b 100644
--- a/storage/errors.py
+++ b/storage/errors.py
@@ -94,6 +94,9 @@ class DiskLabelError(DeviceFormatError):
 class InvalidDiskLabelError(DiskLabelError):
     pass
 
+class DiskLabelCommitError(DiskLabelError):
+    pass
+
 # devicelibs
 class SwapError(StorageError):
     pass
diff --git a/storage/formats/disklabel.py b/storage/formats/disklabel.py
index a387c56..51d37ed 100644
--- a/storage/formats/disklabel.py
+++ b/storage/formats/disklabel.py
@@ -213,14 +213,14 @@ class DiskLabel(DeviceFormat):
                 udev_settle()
 
         if keepTrying:
-            raise DeviceFormatError("cannot commit to disk after %d attempts" % (maxTries,), )
+            raise DiskLabelCommitError("cannot commit to disk after %d attempts" % (maxTries,), )
 
     def commitToDisk(self):
         """ Commit the current partition table to disk. """
         try:
             self.partedDisk.commitToDevice()
         except parted.DiskException as msg:
-            raise DeviceFormatError(msg)
+            raise DiskLabelCommitError(msg)
 
     def addPartition(self, *args, **kwargs):
         partition = kwargs.get("partition", None)
-- 
1.6.0.6

_______________________________________________
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