[master 3/4] Fix container member switching when toggling member encryption.
dwlehman
installerbot-noreply at redhat.com
Tue Jul 28 21:05:36 UTC 2015
From: David Lehman <dlehman at redhat.com>
We need the member we're removing to be a leaf device before we can
destroy it, so we have to remove it from the container first.
---
blivet/devicefactory.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py
index cd87194..d522def 100644
--- a/blivet/devicefactory.py
+++ b/blivet/devicefactory.py
@@ -735,11 +735,13 @@ def _set_encryption(self):
orig_device = self.device
raw_device = self.raw_device
leaf_format = self.device.format
+ if parent_container:
+ parent_container.parents.remove(orig_device)
self.storage.destroyDevice(self.device)
self.storage.formatDevice(self.raw_device, leaf_format)
self.device = raw_device
if parent_container:
- parent_container.parents.replace(orig_device, self.device)
+ parent_container.parents.append(self.device)
elif self.encrypted and not isinstance(self.device, LUKSDevice):
orig_device = self.device
leaf_format = self.device.format
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/94ff0c433f23725c4855eda6d3afb7f072071c3c
More information about the anaconda-patches
mailing list