Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo Development (http://www.linux-archive.org/gentoo-development/)
-   -   Only populate the device tree on demand. (http://www.linux-archive.org/gentoo-development/260012-only-populate-device-tree-demand.html)

David Lehman 03-09-2009 08:28 PM

Only populate the device tree on demand.
 
We don't really want the tree populated when we instantiate it,
so don't populate it until someone calls its populate method.
---
storage/devicetree.py | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)

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
--
1.6.0.6

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

David Lehman 03-09-2009 08:34 PM

Only populate the device tree on demand.
 
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
--
1.6.0.6

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

David Cantrell 03-09-2009 11:55 PM

Only populate the device tree on demand.
 
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@redhat.com>
Red Hat / Honolulu, HI

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


All times are GMT. The time now is 03:04 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.