diff options
author | David Lehman <dlehman@redhat.com> | 2009-09-15 14:24:48 -0500 |
---|---|---|
committer | David Lehman <dlehman@redhat.com> | 2009-10-01 08:59:11 -0500 |
commit | f262fb22f0b60450bd3ae5ab189b82c33994919a (patch) | |
tree | 64fd616dae775f6ce9b19aa18b9282438f7db9e3 | |
parent | 5e7aa5f4d355855856a0d933e4f99ed1614f7cf4 (diff) | |
download | anaconda-f262fb22f0b60450bd3ae5ab189b82c33994919a.tar.gz anaconda-f262fb22f0b60450bd3ae5ab189b82c33994919a.tar.xz anaconda-f262fb22f0b60450bd3ae5ab189b82c33994919a.zip |
Create and use DiskLabelCommitError for failure to commit.
-rw-r--r-- | storage/errors.py | 3 | ||||
-rw-r--r-- | storage/formats/disklabel.py | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/storage/errors.py b/storage/errors.py index d9fe4c805..802806bec 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 192f1da9a..944f535bb 100644 --- a/storage/formats/disklabel.py +++ b/storage/formats/disklabel.py @@ -200,7 +200,7 @@ class DiskLabel(DeviceFormat): try: self.partedDisk.commit() except parted.DiskException as msg: - raise DeviceFormatError(msg) + raise DiskLabelCommitError(msg) else: udev_settle() @@ -209,7 +209,7 @@ class DiskLabel(DeviceFormat): 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) |