[master 1/11] Don't catch and re-raise device create exceptions as DeviceCreateError.
dwlehman
installerbot-noreply at redhat.com
Tue Mar 17 20:07:28 UTC 2015
From: David Lehman <dlehman at redhat.com>
---
blivet/devices/partition.py | 13 -------------
blivet/devices/storage.py | 8 ++------
2 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py
index 2f1d6fc..0498592 100644
--- a/blivet/devices/partition.py
+++ b/blivet/devices/partition.py
@@ -597,19 +597,6 @@ def _postCreate(self):
StorageDevice._postCreate(self)
self._currentSize = Size(self.partedPartition.getLength(unit="B"))
- def create(self):
- """ Create the device. """
- log_method_call(self, self.name, status=self.status)
- self._preCreate()
- try:
- self._create()
- except errors.DiskLabelCommitError as e:
- raise
- except Exception as e:
- raise errors.DeviceCreateError(str(e), self.name)
- else:
- self._postCreate()
-
def _computeResize(self, partition, newsize=None):
""" Return a new constraint and end-aligned geometry for new size.
diff --git a/blivet/devices/storage.py b/blivet/devices/storage.py
index 1dda5e7..1399ec2 100644
--- a/blivet/devices/storage.py
+++ b/blivet/devices/storage.py
@@ -463,12 +463,8 @@ def create(self):
""" Create the device. """
log_method_call(self, self.name, status=self.status)
self._preCreate()
- try:
- self._create()
- except Exception as e:
- raise errors.DeviceCreateError(str(e), self.name)
- else:
- self._postCreate()
+ self._create()
+ self._postCreate()
def _postCreate(self):
""" Perform post-create operations. """
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/b1ec544f44a4274e2d3a029633655421d8d45c35
More information about the anaconda-patches
mailing list