[PATCH 1/2] Use super to get much-needed MRO magic in constructor. (#1158968)

David Lehman dlehman at redhat.com
Wed Nov 5 16:36:40 UTC 2014


super does some magic along the lines of running superclass constructors
breadth-first, which is necessary for container devices that inherit first
from a non-container class.
---
 blivet/devices/dm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/blivet/devices/dm.py b/blivet/devices/dm.py
index 6ce6f71..9234c6e 100644
--- a/blivet/devices/dm.py
+++ b/blivet/devices/dm.py
@@ -67,7 +67,7 @@ class DMDevice(StorageDevice):
                 map name in many cases. The uuid, however, is a persistent UUID
                 stored in device metadata on disk.
         """
-        StorageDevice.__init__(self, name, fmt=fmt, size=size,
+        super(DMDevice, self).__init__(name, fmt=fmt, size=size,
                                exists=exists, uuid=uuid,
                                parents=parents, sysfsPath=sysfsPath)
         self.target = target
-- 
1.9.3



More information about the anaconda-patches mailing list