[master 4/6] Simplify some methods in DeviceFormat class.

mulkieran installerbot-noreply at redhat.com
Wed Mar 11 22:08:13 UTC 2015


From: mulhern <amulhern at redhat.com>

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/formats/__init__.py | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/blivet/formats/__init__.py b/blivet/formats/__init__.py
index ac6395b..4bd9105 100644
--- a/blivet/formats/__init__.py
+++ b/blivet/formats/__init__.py
@@ -204,10 +204,7 @@ def __repr__(self):
 
     @property
     def _existence_str(self):
-        exist = "existing"
-        if not self.exists:
-            exist = "non-existent"
-        return exist
+        return "existing" if self.exists else "non-existent"
 
     @property
     def desc(self):
@@ -322,11 +319,7 @@ def _getDevice(self):
 
     @property
     def name(self):
-        if self._name:
-            name = self._name
-        else:
-            name = self.type
-        return name
+        return self._name or self.type
 
     @property
     def type(self):


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


More information about the anaconda-patches mailing list