[master 9/10] Set format attr after super ctor for md.

dwlehman installerbot-noreply at redhat.com
Mon Jul 20 21:39:30 UTC 2015


From: David Lehman <dlehman at redhat.com>

The MD classes have a circular dependency between level, parents, size,
and format. Setting the format a bit late is a simple way to break it.
---
 blivet/devices/md.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/blivet/devices/md.py b/blivet/devices/md.py
index 592936a..6efafe9 100644
--- a/blivet/devices/md.py
+++ b/blivet/devices/md.py
@@ -106,7 +106,7 @@ def __init__(self, name, level=None, major=None, minor=None, size=None,
         # avoid attribute-defined-outside-init pylint warning
         self._level = None
 
-        super(MDRaidArrayDevice, self).__init__(name, fmt=fmt, uuid=uuid,
+        super(MDRaidArrayDevice, self).__init__(name, uuid=uuid,
                                                 exists=exists, size=size,
                                                 parents=parents,
                                                 sysfsPath=sysfsPath)
@@ -131,6 +131,8 @@ def __init__(self, name, level=None, major=None, minor=None, size=None,
         else:
             self.metadataVersion = metadataVersion
 
+        self.format = fmt
+
         if self.parents and self.parents[0].type == "mdcontainer" and self.type != "mdbiosraidarray":
             raise errors.DeviceError("A device with mdcontainer member must be mdbiosraidarray.")
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/1e0fb20e2c1a142d9215ac0d39dad342c413cfea


More information about the anaconda-patches mailing list