[elbe-devel] [PATCH 33/75] soapclient: Fix Pylint

Torben Hohn torben.hohn at linutronix.de
Fri May 29 12:20:16 CEST 2020


On Mon, May 25, 2020 at 11:42:26AM -0400, Olivier Dion wrote:
> 37:4:  C0415: (import-outside-toplevel)
> 52:0:  R0205: (useless-object-inheritance)
> 74:19: E0701: (bad-except-order)
> 126:0: R0205: (useless-object-inheritance)
> 900:4: R0201: (no-self-use)
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/soapclient.py | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
> index de159451..8fc0df4a 100644
> --- a/elbepack/soapclient.py
> +++ b/elbepack/soapclient.py
> @@ -34,6 +34,7 @@ from elbepack.elbexml import ElbeXML, ValidationMode
>  from elbepack.version import elbe_version, elbe_initvm_packagelist
>  
>  def set_suds_debug(debug):
> +    # pylint: disable=import-outside-toplevel
>      import logging
>      if debug:
>          logging.basicConfig(level=logging.INFO)
> @@ -48,7 +49,8 @@ def set_suds_debug(debug):
>          logging.getLogger('suds.umx.typed').setLevel(logging.ERROR)
>          logging.getLogger('suds.client').setLevel(logging.CRITICAL)
>  
> -
> +# TODO:py3 Remove object inheritance
> +# pylint: disable=useless-object-inheritance
>  class ElbeSoapClient(object):
>      def __init__(self, host, port, user, passwd, retries=10, debug=False):
>  
> @@ -67,11 +69,11 @@ class ElbeSoapClient(object):
>              self.retries += 1
>              try:
>                  self.control = Client(self.wsdl, timeout=cfg['soaptimeout'])
> -            except socket.error as e:
> +            except URLError as e:
>                  if self.retries > retries:
>                      raise e
>                  time.sleep(1)
> -            except URLError as e:
> +            except socket.error as e:
>                  if self.retries > retries:
>                      raise e
>                  time.sleep(1)
> @@ -122,7 +124,8 @@ class ElbeSoapClient(object):
>              fp.write(binascii.a2b_base64(ret))
>              part = part + 1
>  
> -
> +# TODO:py3 Remove object inheritance
> +# pylint: disable=useless-object-inheritance
>  class ClientAction(object):
>      actiondict = {}
>  
> @@ -897,7 +900,8 @@ class UploadPackageAction(RepoAction):
>      def __init__(self, node):
>          RepoAction.__init__(self, node)
>  
> -    def upload_file(self, client, f, builddir):
> +    @staticmethod
> +    def upload_file(client, f, builddir):
>          # Uploads file f into builddir in intivm
>          size = 1024 * 1024
>          part = 0
> -- 
> 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