[elbe-devel] [PATCH 11/13] pylint - updated: fix redefining name

Manuel Traut manut at linutronix.de
Thu Aug 30 17:05:22 CEST 2018


updated.py:133, PyLint, Priority: Normal
Redefining name 'version' from outer scope (line 41)

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/updated.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/elbepack/updated.py b/elbepack/updated.py
index 6019d73a..6b93dc43 100644
--- a/elbepack/updated.py
+++ b/elbepack/updated.py
@@ -131,21 +131,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):
@@ -247,14 +247,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")
 
 
-- 
2.18.0




More information about the elbe-devel mailing list