[master 2/3] Simplify Device.dependsOn.

mulkieran installerbot-noreply at redhat.com
Thu Mar 19 13:16:41 UTC 2015


From: mulhern <amulhern at redhat.com>

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/devices/device.py | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/blivet/devices/device.py b/blivet/devices/device.py
index 90a2718..250bc97 100644
--- a/blivet/devices/device.py
+++ b/blivet/devices/device.py
@@ -221,15 +221,7 @@ def dependsOn(self, dep):
             :returns: whether this device depends on 'dep'
             :rtype: bool
         """
-        # XXX does a device depend on itself?
-        if dep in self.parents:
-            return True
-
-        for parent in self.parents:
-            if parent.dependsOn(dep):
-                return True
-
-        return False
+        return dep in self.parents or any(p.dependsOn(dep) for p in self.parents)
 
     def dracutSetupArgs(self):
         return set()


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


More information about the anaconda-patches mailing list