[rhel7-branch 1/4] Fix setupDiskImages when the devices are already in the tree. (#1252703)

bcl installerbot-noreply at redhat.com
Fri Aug 14 16:45:34 UTC 2015


From: David Lehman <dlehman at redhat.com>

Related: rhbz#1252703

(cherry picked from commit 9fef3b28dbd3097fbf8eb098a80ef213454b9bf3)
---
 blivet/devicetree.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 94a909e..70b0df0 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -2103,6 +2103,13 @@ def setupDiskImages(self):
         """ Set up devices to represent the disk image files. """
         for (name, path) in self.diskImages.items():
             log.info("setting up disk image file '%s' as '%s'", path, name)
+            dmdev = self.getDeviceByName(name)
+            if dmdev and isinstance(dmdev, DMLinearDevice) and \
+               path in (d.path for d in dmdev.ancestors):
+                log.debug("using %s", dmdev)
+                dmdev.setup()
+                continue
+
             try:
                 filedev = FileDevice(path, exists=True)
                 filedev.setup()


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


More information about the anaconda-patches mailing list