[PATCH] put dmraid in first storage screen.

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

 



This is my test patch.

-- 
Joel Andres Granados
Brno, Czech Republic, Red Hat.
>From 837826738017906d147d3151fbcbdb972e842971 Mon Sep 17 00:00:00 2001
From: Joel Granados Moreno <jgranado@xxxxxxxxxx>
Date: Mon, 2 Mar 2009 15:39:02 +0100
Subject: [PATCH] Get the dmraid into the storage screen.

---
 iw/autopart_type.py   |    9 +++++----
 storage/__init__.py   |    5 ++++-
 storage/devices.py    |    6 +++++-
 storage/devicetree.py |    1 -
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/iw/autopart_type.py b/iw/autopart_type.py
index bb38533..bb2e9ff 100644
--- a/iw/autopart_type.py
+++ b/iw/autopart_type.py
@@ -382,13 +382,14 @@ class PartitionTypeWindow(InstallWindow):
             defaultBoot = None
         for disk in self.storage.disks:
             partedDisk = disk.partedDisk
-            if partedDisk.device.path[5:] not in self.anaconda.id.bootloader.drivelist:
+            # the name without the path.
+            diskname = partedDisk.device.path.split('/')[-1]
+            if diskname not in self.anaconda.id.bootloader.drivelist:
                 continue
             size = partedDisk.device.getSize(unit="MB")
-            dispstr = "%s %8.0f MB %s" %(partedDisk.device.path[5:],
-                                         size, partedDisk.device.model)
+            dispstr = "%s %8.0f MB %s" %(diskname, size, partedDisk.device.model)
             i = bootstore.append(None)
-            bootstore[i] = (dispstr, partedDisk.device.path[5:])
+            bootstore[i] = (dispstr, diskname)
             if disk.name == defaultBoot:
                 self.bootcombo.set_active_iter(i)
 
diff --git a/storage/__init__.py b/storage/__init__.py
index 5cfebb3..e11bd79 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -186,7 +186,10 @@ class Storage(object):
             does not necessarily reflect the actual on-disk state of the
             system's disks.
         """
-        disks = [d for d in self.devicetree.devices if isinstance(d, DiskDevice)]
+        disks = []
+        for key,d in self.devicetree.devices.iteritems():
+            if isinstance(d, DiskDevice):
+                disks.append(d)
         disks.sort(key=lambda d: d.name)
         return disks
 
diff --git a/storage/devices.py b/storage/devices.py
index b1a3130..7e5c567 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2018,7 +2018,7 @@ class MDRaidArrayDevice(StorageDevice):
         self.exists = False
 
 
-class DMRaidArrayDevice(DiskDevice):
+class DMRaidArrayDevice(DMDevice, DiskDevice):
     """ A dmraid (device-mapper RAID) device """
     _type = "dm-raid array"
     _packages = ["dmraid"]
@@ -2102,6 +2102,10 @@ class DMRaidArrayDevice(DiskDevice):
     def deactivate(self):
         self._raidSet.deactivate()
 
+    def probe(self):
+        # Its not relevant for dmraids
+        pass
+
     # UGLY copied from DMDevice, we are more like a disk, but also a bit
     # a DMDevice <sigh>
     def updateSysfsPath(self):
diff --git a/storage/devicetree.py b/storage/devicetree.py
index 486ca98..e444883 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -720,7 +720,6 @@ class DeviceTree(object):
                                                  parents=[device])
                     self._addDevice(md_array)
             elif format.type == "dmraidmember":
-                import pdb ; pdb.set_trace()
                 # Have we already created the DMRaidArrayDevice?
                 rs = block.getRaidSetFromRelatedMem(uuid=uuid, name=name, \
                         major = udev_device_get_major(info), \
-- 
1.6.0.6

_______________________________________________
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