FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 04-01-2011, 07:57 PM
David Lehman
 
Default Add "disks" attr to StorageDevice to list disks a device depends on.

---
pyanaconda/storage/devices.py | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 017d48c..9133a6b 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -514,6 +514,20 @@ class StorageDevice(Device):
return services

@property
+ def disks(self):
+ """ A list of all disks this device depends on, including itself. """
+ _disks = []
+ for parent in self.parents:
+ for disk in parent.disks:
+ if disk not in _disks:
+ _disks.append(disk)
+
+ if self.isDisk and not self.format.hidden:
+ _disks.append(self)
+
+ return _disks
+
+ @property
def partedDevice(self):
if self.exists and self.status and not self._partedDevice:
log.debug("looking up parted Device: %s" % self.path)
--
1.7.3.4

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

Thread Tools




All times are GMT. The time now is 06:44 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org