Re: [PATCH] Only populate the device tree on demand.

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

 



On 03/09/2009 11:34 AM, David Lehman wrote:
We don't really want the tree populated when we instantiate it,
so don't populate it until someone calls its populate method.
---
  storage/__init__.py   |    2 ++
  storage/devicetree.py |    4 +---
  2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index 51a892d..4d8c13b 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -167,6 +167,7 @@ class Storage(object):
          self.defaultFSType = get_default_filesystem_type()
          self.defaultBootFSType = get_default_filesystem_type(boot=True)

+        # these will both be empty until our reset method gets called
          self.devicetree = DeviceTree(intf=self.anaconda.intf,
                                       ignored=self.ignoredDisks,
                                       exclusive=self.exclusiveDisks,
@@ -216,6 +217,7 @@ class Storage(object):
                                       zeroMbr=self.zeroMbr,
                                       passphrase=self.encryptionPassphrase,
                                       luksDict=self.__luksDevs)
+        self.devicetree.populate()
          self.fsset = FSSet(self.devicetree)
          w.pop()

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 1692b0e..7bd9ecc 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -170,8 +170,6 @@ class DeviceTree(object):
          if luksDict and isinstance(luksDict, dict):
              self.__luksDevs = luksDict

-        self._populate()
-
      def pruneActions(self):
          """ Prune loops and redundant actions from the queue. """
          # handle device destroy actions
@@ -1101,7 +1099,7 @@ class DeviceTree(object):
                                  log.info("setup of %s failed: %s"
                                                      % (lv_device.name, e))

-    def _populate(self):
+    def populate(self):
          """ Locate all storage devices. """
          # each iteration scans any devices that have appeared since the
          # previous iteration

Looks good.

--
David Cantrell <dcantrell@xxxxxxxxxx>
Red Hat / Honolulu, HI

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux