[elbe-devel] [PATCH 06/40] pylint: test/updated - fix redefine

Torben Hohn torben.hohn at linutronix.de
Thu Sep 20 11:07:23 CEST 2018


On Fri, Sep 14, 2018 at 01:56:18PM +0200, Manuel Traut wrote:
> test/updated.py: Redefining name 'monitor' from outer scope
> updated.py:      Redefining name 'version' from outer scope
> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>

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

> ---
>  elbepack/updated.py | 16 ++++++++--------
>  test/updated.py     |  8 ++++----
>  2 files changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/elbepack/updated.py b/elbepack/updated.py
> index 09e8d674..b941f172 100644
> --- a/elbepack/updated.py
> +++ b/elbepack/updated.py
> @@ -130,21 +130,21 @@ class UpdateService (ServiceBase):
>          return snapshots
>  
>      @rpc(String, _returns=String)
> -    def apply_snapshot(self, version):
> -        if version == "base_version":
> +    def apply_snapshot(self, ver):
> +        if ver == "base_version":
>              fname = "/etc/elbe_base.xml"
>          else:
> -            fname = self.app.status.repo_dir + "/" + version + "/new.xml"
> +            fname = self.app.status.repo_dir + "/" + ver + "/new.xml"
>  
>          try:
>              apply_update(fname, self.app.status)
>          except Exception as err:
>              print("%s" % str(err))
>              self.app.status.set_finished('error')
> -            return "apply snapshot %s failed" % version
> +            return "apply snapshot %s failed" % ver
>  
>          self.app.status.set_finished('OK')
> -        return "snapshot %s applied" % version
> +        return "snapshot %s applied" % ver
>  
>      @rpc(String)
>      def register_monitor(self, wsdl_url):
> @@ -245,14 +245,14 @@ def update_sourceslist(xml, update_dir, status):
>          f.write(deb)
>  
>  
> -def mark_install(depcache, pkg, version, auto, status):
> +def mark_install(depcache, pkg, ver, auto, status):
>      for v in pkg.version_list:
> -        if v.ver_str == str(version):
> +        if v.ver_str == str(ver):
>              depcache.set_candidate_ver(pkg, v)
>              depcache.mark_install(pkg, False, not auto)
>              return
>  
> -    status.log("ERROR: " + pkg.name + version +
> +    status.log("ERROR: " + pkg.name + ver +
>                 " is not available in the cache")
>  
>  
> diff --git a/test/updated.py b/test/updated.py
> index 0c3b6bfd..3d2b7f1d 100755
> --- a/test/updated.py
> +++ b/test/updated.py
> @@ -44,11 +44,11 @@ class MonitorThread (threading.Thread):
>          self.server.serve_forever()
>  
>  
> -def shutdown(monitor):
> -    if monitor.server:
> -        monitor.server.shutdown()
> +def shutdown(mon):
> +    if mon.server:
> +        mon.server.shutdown()
>  
> -    monitor.join()
> +    mon.join()
>      sys.exit(0)
>  
>  
> -- 
> 2.19.0.rc2
> 

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20180920/af362fd0/attachment.sig>


More information about the elbe-devel mailing list