Re: [PATCH4/6] Don't create array if already exists

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

 





On 04/10/2009 03:33 PM, Jacek Danecki wrote:
If array was created before this patch disallow to create new
MDRaidArrayDevice object.

It make an assumption that array for md member is created by function
handleUdevMDMeberFormat.
Maybe we can drop function addUdevMDDevice?


Attached patch:

-- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -998,6 +998,15 @@ class DeviceTree(object):
             except (KeyError, IndexError, ValueError) as e:
                 log.warning("invalid data for %s: %s" % (name, e))
                 return
+
+            if md_uuid:
+                md_array = self.getDeviceByUuid(md_uuid)
+                if md_array:
+                    log.debug("MD array md_uuid=%s already created" % (md_uuid))
+                    return md_array
+
+            if self.md_is_container(md_level):
+                 return device

             device = MDRaidArrayDevice(name,
                                        level=md_level,


Erm, shouldn't that last return be "return None" or just "return" ?

Regards,

Hans

_______________________________________________
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