[blivet:master 12/20] Make a method terser

mulhern amulhern at redhat.com
Fri Apr 11 18:03:54 UTC 2014


This was prompted by some pylint complaints about variable names.

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

diff --git a/blivet/devices.py b/blivet/devices.py
index 2671e88..dfe05ad 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -1926,13 +1926,9 @@ class DMDevice(StorageDevice):
 
     @property
     def status(self):
-        _status = False
-        for map in block.dm.maps():
-            if map.name == self.mapName:
-                _status = map.live_table and not map.suspended
-                break
-
-        return _status
+        return next((m.live_table and not m.suspended \
+           for m in block.dm.maps() if m.name == self.mapName),
+           False)
 
     def updateSysfsPath(self):
         """ Update this device's sysfs path. """
-- 
1.8.3.1



More information about the anaconda-patches mailing list