[blivet:master 12/21] Use has_redundancy raid property when checking whether a device is removable
mulhern
amulhern at redhat.com
Sat May 17 18:50:57 UTC 2014
There is a semantic change here, an error will be raised in the case of
every non-redundant raid, which in this case includes "container" as well
as "raid0".
Signed-off-by: mulhern <amulhern at redhat.com>
---
blivet/devices.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/blivet/devices.py b/blivet/devices.py
index 29dc1db..54aaa62 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -3447,7 +3447,11 @@ class MDRaidArrayDevice(ContainerDevice):
self.memberDevices += 1
def _removeParent(self, member):
- if self.level.name == "raid0" and self.exists and member.format.exists:
+ """ If this is a raid array that is not actually redundant and it
+ appears to have formatting and therefore probably data on it,
+ removing one of its devices is a bad idea.
+ """
+ if not self.level.has_redundancy and self.exists and member.format.exists:
raise errors.DeviceError("cannot remove members from existing raid0")
super(MDRaidArrayDevice, self)._removeParent(member)
--
1.8.3.1
More information about the anaconda-patches
mailing list