[elbe-devel] [PATCH 32/40] pylint: annotate or remove unused variables

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


asyncworker.py:
  annotate, because it's nice for consistency between the other
  enqueue calls

efilesystem.py, initvmaction.py, repomanager.py:
  remove unused variables

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/asyncworker.py  |  1 +
 elbepack/efilesystem.py  |  4 +---
 elbepack/initvmaction.py |  2 --
 elbepack/repomanager.py  | 14 +++++++-------
 4 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/elbepack/asyncworker.py b/elbepack/asyncworker.py
index 313d9234..b54de2ae 100644
--- a/elbepack/asyncworker.py
+++ b/elbepack/asyncworker.py
@@ -26,6 +26,7 @@ class AsyncWorkerJob(object):
         self.old_status = None
 
     def enqueue(self, queue, db):
+        #pylint: disable=unused-argument
         queue.put(self)
 
     def execute(self, db):
diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index e6a8c2ab..5ab6601b 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -334,7 +334,6 @@ class TargetFs(ChRootFilesystem):
                 pass
 
         if self.xml.has("target/package/cpio"):
-            oldwd = os.getcwd()
             cpio_name = self.xml.text("target/package/cpio/name")
             os.chdir(self.fname(''))
             try:
@@ -349,7 +348,6 @@ class TargetFs(ChRootFilesystem):
                 pass
 
         if self.xml.has("target/package/squashfs"):
-            oldwd = os.getcwd()
             sfs_name = self.xml.text("target/package/squashfs/name")
             os.chdir(self.fname(''))
             try:
@@ -358,7 +356,7 @@ class TargetFs(ChRootFilesystem):
                     (self.fname(''), targetdir, sfs_name))
                 # only append filename if creating mksquashfs was successful
                 self.images.append(sfs_name)
-            except CommandError as e:
+            except CommandError:
                 # error was logged; continue
                 pass
 
diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index 8f9929cd..f7526cb6 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -590,13 +590,11 @@ class SubmitAction(InitVMAction):
             if args[0].endswith('.xml'):
                 # We have an xml file, use that for elbe init
                 xmlfile = args[0]
-                url_validation = ''
             elif args[0].endswith('.iso'):
                 # We have an iso image, extract xml from there.
                 tmp = extract_cdrom(args[0])
 
                 xmlfile = tmp.fname('source.xml')
-                url_validation = '--skip-urlcheck'
                 cdrom = args[0]
             else:
                 print(
diff --git a/elbepack/repomanager.py b/elbepack/repomanager.py
index 4e37daeb..9b6085a6 100644
--- a/elbepack/repomanager.py
+++ b/elbepack/repomanager.py
@@ -208,7 +208,7 @@ class RepoBase(object):
                 # different md5 already.
                 #
                 # Try remove, and add again.
-                self.removedeb(pkgname, component)
+                self.removedeb(pkgname)
                 self._includedeb(path, self.repo_attr.codename, component)
             else:
                 raise ce
@@ -228,7 +228,7 @@ class RepoBase(object):
             "reprepro --basedir %s remove %s %s" %
             (self.fs.path, codename, pkgname))
 
-    def removedeb(self, pkgname, component="main"):
+    def removedeb(self, pkgname):
         self._removedeb(pkgname, self.repo_attr.codename)
 
     def _removesrc(self, srcname, codename):
@@ -236,12 +236,12 @@ class RepoBase(object):
             "reprepro --basedir %s removesrc %s %s" %
             (self.fs.path, codename, srcname))
 
-    def removesrc(self, path, component="main"):
+    def removesrc(self, path):
         for p in Deb822.iter_paragraphs(file(path)):
             if 'Source' in p:
                 self._removesrc(p['Source'], self.repo_attr.codename)
 
-    def _remove(self, path, codename, component):
+    def _remove(self, path, codename):
         os.environ['GNUPGHOME'] = "/var/cache/elbe/gnupg"
         for p in Deb822.iter_paragraphs(file(path)):
             if 'Source' in p:
@@ -278,7 +278,7 @@ class RepoBase(object):
                 # different md5 already.
                 #
                 # Try remove, and add again.
-                self.removesrc(path, component)
+                self.removesrc(path)
                 self._includedsc(path, self.repo_attr.codename, component)
             else:
                 raise ce
@@ -286,8 +286,8 @@ class RepoBase(object):
     def include(self, path, component="main"):
         self._include(path, self.repo_attr.codename, component)
 
-    def remove(self, path, component="main"):
-        self._remove(path, self.repo_attr.codename, component)
+    def remove(self, path):
+        self._remove(path, self.repo_attr.codename)
 
     def include_init_dsc(self, path, component="main"):
         self._includedsc(path, self.init_attr.codename, component)
-- 
2.19.0.rc2




More information about the elbe-devel mailing list