[blivet:master 4/9] Rewrite resize() method to depend on _resizable.
mulhern
amulhern at redhat.com
Wed Apr 23 21:49:28 UTC 2014
All class for which _resizable is True should define a resize method.
Prompted by a lot of pylint 'abstract-method' warnings.
Signed-off-by: mulhern <amulhern at redhat.com>
---
blivet/devices.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/blivet/devices.py b/blivet/devices.py
index 36a2853..9d04bb7 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -762,7 +762,10 @@ class StorageDevice(Device):
Returns nothing.
"""
- raise NotImplementedError("resize method not defined for StorageDevice")
+ if self._resizable:
+ raise NotImplementedError("method not implemented for device type %s" % self.type)
+ else:
+ raise errors.DeviceError("device type %s is not resizable" % self.type)
#
# setup
--
1.8.3.1
More information about the anaconda-patches
mailing list