[elbe-devel] [PATCH 38/75] fstab: Fix Pylint

Torben Hohn torben.hohn at linutronix.de
Fri May 29 12:26:38 CEST 2020


On Mon, May 25, 2020 at 11:42:31AM -0400, Olivier Dion wrote:
> 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.26.2
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list