[PATCH 2/3] Allow DiskLabelCommitError to reach the caller. (#1001586)

David Lehman dlehman at redhat.com
Tue Sep 3 19:07:48 UTC 2013


---
 blivet/devices.py | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/blivet/devices.py b/blivet/devices.py
index 4877a39..5772ec4 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -1531,6 +1531,20 @@ class PartitionDevice(StorageDevice):
         StorageDevice._postCreate(self)
         self._currentSize = self.partedPartition.getSize()
 
+    @exclusive
+    def create(self):
+        """ Create the device. """
+        log_method_call(self, self.name, status=self.status)
+        self._preCreate()
+        try:
+            self._create()
+        except DiskLabelCommitError as e:
+            raise
+        except Exception as e:
+            raise DeviceCreateError(str(e), self.name)
+        else:
+            self._postCreate()
+
     def _computeResize(self, partition):
         log_method_call(self, self.name, status=self.status)
 
-- 
1.8.1.4



More information about the anaconda-patches mailing list