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

Manuel Traut manut at linutronix.de
Fri Sep 14 13:56:18 CEST 2018


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>
---
 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




More information about the elbe-devel mailing list