[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 3/3] Set up disk images earlier so kickstart device filtering works on them.



---
 anaconda                         |    1 +
 pyanaconda/storage/__init__.py   |    4 ++++
 pyanaconda/storage/devicetree.py |   12 ++++++++----
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/anaconda b/anaconda
index 2116571..83f47d2 100755
--- a/anaconda
+++ b/anaconda
@@ -626,6 +626,7 @@ if __name__ == "__main__":
         anaconda.storage.config.diskImages[name] = path
         image_count += 1
         flags.imageInstall = True
+    anaconda.storage.setupDiskImages()
 
     if opts.vnc:
         flags.usevnc = 1
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index e815c20..b6146a6 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -966,6 +966,10 @@ class Storage(object):
                     log.error("failed to add new passphrase to existing "
                               "device %s" % device.path)
 
+    def setupDiskImages(self):
+        self.devicetree.setDiskImages(self.config.diskImages)
+        self.devicetree.setupDiskImages()
+
     def sanityCheck(self):
         """ Run a series of tests to verify the storage configuration.
 
diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index a3ddde2..d36a870 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -172,10 +172,7 @@ class DeviceTree(object):
         self.iscsi = iscsi
         self.dasd = dasd
 
-        # disk image files are automatically exclusive
-        self.diskImages = getattr(conf, "diskImages", {})
-        if self.diskImages:
-            self.exclusiveDisks = self.diskImages.keys()
+        self.setDiskImages(getattr(conf, "diskImages", {}))
 
         # protected device specs as provided by the user
         self.protectedDevSpecs = getattr(conf, "protectedDevSpecs", [])
@@ -199,6 +196,12 @@ class DeviceTree(object):
 
         self._cleanup = False
 
+    def setDiskImages(self, images):
+        """ Set the disk images and reflect them in exclusiveDisks. """
+        self.diskImages = images
+        # disk image files are automatically exclusive
+        self.exclusiveDisks = self.diskImages.keys()
+
     def addIgnoredDisk(self, disk):
         self._ignoredDisks.append(disk)
         devicelibs.lvm.lvm_cc_addFilterRejectRegexp(disk)
@@ -1574,6 +1577,7 @@ class DeviceTree(object):
         return ret
 
     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))
             try:
-- 
1.7.3.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]