[master 4/4] Do basic child accounting when replacing a parent.

dwlehman installerbot-noreply at redhat.com
Wed Jul 29 14:25:55 UTC 2015


From: David Lehman <dlehman at redhat.com>

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

diff --git a/blivet/devices/lib.py b/blivet/devices/lib.py
index 5faada5..f760c89 100644
--- a/blivet/devices/lib.py
+++ b/blivet/devices/lib.py
@@ -169,12 +169,19 @@ def replace(self, x, y):
 
             .. note::
 
+                This method does update the child counts for the two devices.
+
+            .. note::
+
                 It is usually a bad idea to bypass the callbacks. This is
                 intended for specific circumstances like toggling encryption of
                 container member devices in the devicefactory classes.
+
         """
         if x not in self.items:
             raise ValueError("item to be replaced is not in the list")
 
         idx = self.items.index(x)
         self.items[idx] = y
+        x.removeChild()
+        y.addChild()


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/fb70b519e2f391818317e26c7ccd909a24032809


More information about the anaconda-patches mailing list