[elbe-devel] [PATCH v2 31/66] fstab: Fix Pylint

Olivier Dion dion at linutronix.de
Fri Jun 5 19:06:55 CEST 2020


74:0:  R0205: (useless-object-inheritance)
119:4: R0911: (too-many-return-statements)

Signed-off-by: Olivier Dion <dion at linutronix.de>
Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/fstab.py | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/elbepack/fstab.py b/elbepack/fstab.py
index ee23121a..425c9132 100644
--- a/elbepack/fstab.py
+++ b/elbepack/fstab.py
@@ -71,6 +71,8 @@ class mountpoint_dict (dict):
         return [self[x] for x in mplist]
 
 
+# TODO:py3 Remove object inheritance
+# pylint: disable=useless-object-inheritance
 class fstabentry(object):
 
     # pylint: disable=too-many-instance-attributes
@@ -117,19 +119,10 @@ class fstabentry(object):
             depth += 1
 
     def get_label_opt(self):
-        if self.fstype == "ext4":
-            return "-L " + self.label
-        if self.fstype == "ext2":
-            return "-L " + self.label
-        if self.fstype == "ext3":
+        if self.fstype in ("ext4", "ext3", "ext2", "xfs", "btrfs"):
             return "-L " + self.label
         if self.fstype == "vfat":
             return "-n " + self.label
-        if self.fstype == "xfs":
-            return "-L " + self.label
-        if self.fstype == "btrfs":
-            return "-L " + self.label
-
         return ""
 
     def set_geometry(self, ppart, disk):
-- 
2.27.0




More information about the elbe-devel mailing list