[elbe-devel] [PATCH 12/25] pylint: fix unused args and unused vars

Torben Hohn torben.hohn at linutronix.de
Wed Aug 22 10:42:13 CEST 2018


When running "pylint -f parseable -d all -e W0612,W0613" we get this:

------------------------------------------------------------------------------------------------------------------
************* Module elbepack.elbeproject
elbepack/elbeproject.py:406: [W0613(unused-argument), ElbeProject.build] Unused argument 'skip_debootstrap'
elbepack/elbeproject.py:522: [W0612(unused-variable), ElbeProject.build] Unused variable 'e'
elbepack/elbeproject.py:407: [W0613(unused-argument), ElbeProject.build] Unused argument 'debug'
elbepack/elbeproject.py:644: [W0612(unused-variable), ElbeProject.pdebuild_build] Unused variable 'e'
************* Module elbepack.initvmaction
elbepack/initvmaction.py:128: [W0613(unused-argument), StartAction.execute] Unused argument 'opt'
elbepack/initvmaction.py:138: [W0612(unused-variable), StartAction.execute] Unused variable 'i'
elbepack/initvmaction.py:128: [W0613(unused-argument), StartAction.execute] Unused argument 'args'
elbepack/initvmaction.py:128: [W0613(unused-argument), StartAction.execute] Unused argument 'initvmdir'
elbepack/initvmaction.py:155: [W0613(unused-argument), EnsureAction.execute] Unused argument 'opt'
elbepack/initvmaction.py:155: [W0613(unused-argument), EnsureAction.execute] Unused argument 'args'
elbepack/initvmaction.py:155: [W0613(unused-argument), EnsureAction.execute] Unused argument 'initvmdir'
elbepack/initvmaction.py:175: [W0613(unused-argument), StopAction.execute] Unused argument 'opt'
elbepack/initvmaction.py:175: [W0613(unused-argument), StopAction.execute] Unused argument 'args'
elbepack/initvmaction.py:175: [W0613(unused-argument), StopAction.execute] Unused argument 'initvmdir'
elbepack/initvmaction.py:206: [W0613(unused-argument), AttachAction.execute] Unused argument 'opt'
elbepack/initvmaction.py:206: [W0613(unused-argument), AttachAction.execute] Unused argument 'args'
elbepack/initvmaction.py:206: [W0613(unused-argument), AttachAction.execute] Unused argument 'initvmdir'
elbepack/initvmaction.py:225: [W0613(unused-argument), StartBuildAction.execute] Unused argument 'opt'
elbepack/initvmaction.py:229: [W0612(unused-variable), StartBuildAction.execute] Unused variable 'e'
elbepack/initvmaction.py:225: [W0613(unused-argument), StartBuildAction.execute] Unused argument 'args'
elbepack/initvmaction.py:427: [W0612(unused-variable), CreateAction.execute] Unused variable 'msg'
elbepack/initvmaction.py:564: [W0612(unused-variable), SubmitAction.execute] Unused variable 'url_validation'
elbepack/initvmaction.py:615: [W0612(unused-variable), SubmitAction.execute] Unused variable 'msg'
elbepack/initvmaction.py:549: [W0613(unused-argument), SubmitAction.execute] Unused argument 'initvmdir'
************* Module elbepack.finetuning
elbepack/finetuning.py:46: [W0613(unused-argument), RmAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:71: [W0613(unused-argument), MkdirAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:85: [W0613(unused-argument), MknodAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:104: [W0613(unused-argument), BuildenvMkdirAction.execute] Unused argument 'target'
elbepack/finetuning.py:118: [W0613(unused-argument), CpAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:134: [W0613(unused-argument), BuildenvCpAction.execute] Unused argument 'target'
elbepack/finetuning.py:182: [W0613(unused-argument), T2PMvAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:204: [W0613(unused-argument), MvAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:220: [W0613(unused-argument), LnAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:237: [W0613(unused-argument), BuildenvMvAction.execute] Unused argument 'target'
elbepack/finetuning.py:253: [W0613(unused-argument), AddUserAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:302: [W0613(unused-argument), AddGroupAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:326: [W0613(unused-argument), RawCmdAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:341: [W0613(unused-argument), CmdAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:356: [W0613(unused-argument), BuildenvCmdAction.execute] Unused argument 'target'
elbepack/finetuning.py:371: [W0613(unused-argument), PurgeAction.execute] Unused argument 'buildenv'
elbepack/finetuning.py:419: [W0612(unused-variable), UpdatedAction.execute] Unused variable 've'
elbepack/finetuning.py:432: [W0612(unused-variable), UpdatedAction.execute] Unused variable 'te'
elbepack/finetuning.py:425: [W0612(unused-variable), UpdatedAction.execute] Unused variable 'fe'
************* Module elbepack.rpcaptcache
elbepack/rpcaptcache.py:148: [W0613(unused-argument), RPCAPTCache.mark_delete] Unused argument 'version'
elbepack/rpcaptcache.py:152: [W0613(unused-argument), RPCAPTCache.mark_keep] Unused argument 'version'
************* Module elbepack.pbuilder
elbepack/pbuilder.py:13: [W0613(unused-argument), pbuilder_ensure_chroot] Unused argument 'builddir'
elbepack/pbuilder.py:17: [W0613(unused-argument), pbuilder_write_config] Unused argument 'log'
************* Module elbepack.updated
elbepack/updated.py:178: [W0612(unused-variable), rw_access.__exit__] Unused variable 'ret'
elbepack/updated.py:461: [W0612(unused-variable), action_select] Unused variable 'dirname'
elbepack/updated.py:461: [W0612(unused-variable), action_select] Unused variable 'filename'
elbepack/updated.py:490: [W0612(unused-variable), action_select] Unused variable 'pathname'
elbepack/updated.py:542: [W0612(unused-variable), is_update_file] Unused variable 'root'
elbepack/updated.py:563: [W0612(unused-variable), handle_update_file] Unused variable 'root'
elbepack/updated.py:584: [W0613(unused-argument), shutdown] Unused argument 'fname'
elbepack/updated.py:584: [W0613(unused-argument), shutdown] Unused argument 'signum'
************* Module elbepack.repomanager
elbepack/repomanager.py:224: [W0613(unused-argument), RepoBase._removedeb] Unused argument 'component'
elbepack/repomanager.py:232: [W0613(unused-argument), RepoBase._removesrc] Unused argument 'component'
elbepack/repomanager.py:335: [W0613(unused-argument), CdromInitRepo.__init__] Unused argument 'arch'
************* Module elbepack.archivedir
elbepack/archivedir.py:82: [W0613(unused-argument), get_and_append_unknown] Unused argument 'archive'
elbepack/archivedir.py:104: [W0612(unused-variable), _combinearchivedir] Unused variable 'ex'
************* Module elbepack.pkgutils
elbepack/pkgutils.py:213: [W0612(unused-variable), download_pkg] Unused variable 'e'
************* Module elbepack.efilesystem
elbepack/efilesystem.py:328: [W0612(unused-variable), TargetFs.part_target] Unused variable 'e'
elbepack/efilesystem.py:333: [W0612(unused-variable), TargetFs.part_target] Unused variable 'oldwd'
************* Module elbepack.ziparchives
elbepack/ziparchives.py:13: [W0612(unused-variable), create_zip_archive] Unused variable 'dirs'
************* Module elbepack.asyncworker
elbepack/asyncworker.py:27: [W0613(unused-argument), AsyncWorkerJob.enqueue] Unused argument 'db'
elbepack/asyncworker.py:52: [W0612(unused-variable), BuildSysrootJob.execute] Unused variable 'e'
elbepack/asyncworker.py:77: [W0612(unused-variable), BuildSDKJob.execute] Unused variable 'e'
elbepack/asyncworker.py:104: [W0612(unused-variable), BuildCDROMsJob.execute] Unused variable 'e'
elbepack/asyncworker.py:128: [W0612(unused-variable), BuildChrootTarJob.execute] Unused variable 'e'
elbepack/asyncworker.py:233: [W0612(unused-variable), PdebuildJob.execute] Unused variable 'e'
elbepack/asyncworker.py:259: [W0612(unused-variable), CreatePbuilderJob.execute] Unused variable 'e'
elbepack/asyncworker.py:283: [W0612(unused-variable), UpdatePbuilderJob.execute] Unused variable 'e'
************* Module elbepack.soapclient
elbepack/soapclient.py:88: [W0612(unused-variable), ElbeSoapClient.download_file] Unused variable 'e'
elbepack/soapclient.py:134: [W0613(unused-argument), RemoveLogAction.execute] Unused argument 'opt'
elbepack/soapclient.py:153: [W0613(unused-argument), ListProjectsAction.execute] Unused argument 'opt'
elbepack/soapclient.py:153: [W0613(unused-argument), ListProjectsAction.execute] Unused argument 'args'
elbepack/soapclient.py:174: [W0613(unused-argument), ListUsersAction.execute] Unused argument 'opt'
elbepack/soapclient.py:174: [W0613(unused-argument), ListUsersAction.execute] Unused argument 'args'
elbepack/soapclient.py:189: [W0613(unused-argument), AddUserAction.execute] Unused argument 'opt'
elbepack/soapclient.py:222: [W0613(unused-argument), CreateProjectAction.execute] Unused argument 'opt'
elbepack/soapclient.py:222: [W0613(unused-argument), CreateProjectAction.execute] Unused argument 'args'
elbepack/soapclient.py:238: [W0613(unused-argument), ResetProjectAction.execute] Unused argument 'opt'
elbepack/soapclient.py:259: [W0613(unused-argument), DeleteProjectAction.execute] Unused argument 'opt'
elbepack/soapclient.py:280: [W0613(unused-argument), SetXmlAction.execute] Unused argument 'opt'
elbepack/soapclient.py:295: [W0612(unused-variable), SetXmlAction.execute] Unused variable 'e'
elbepack/soapclient.py:358: [W0613(unused-argument), BuildSysrootAction.execute] Unused argument 'opt'
elbepack/soapclient.py:379: [W0613(unused-argument), BuildSDKAction.execute] Unused argument 'opt'
elbepack/soapclient.py:458: [W0613(unused-argument), BuildChrootAction.execute] Unused argument 'opt'
elbepack/soapclient.py:480: [W0613(unused-argument), DumpFileAction.execute] Unused argument 'opt'
elbepack/soapclient.py:559: [W0613(unused-argument), WaitProjectBusyAction.execute] Unused argument 'opt'
elbepack/soapclient.py:607: [W0613(unused-argument), SetCdromAction.execute] Unused argument 'opt'
elbepack/soapclient.py:640: [W0613(unused-argument), SetOrigAction.execute] Unused argument 'opt'
elbepack/soapclient.py:674: [W0613(unused-argument), ShutdownInitvmAction.execute] Unused argument 'opt'
elbepack/soapclient.py:729: [W0613(unused-argument), BuildPbuilderAction.execute] Unused argument 'opt'
elbepack/soapclient.py:750: [W0613(unused-argument), UpdatePbuilderAction.execute] Unused argument 'opt'
elbepack/soapclient.py:789: [W0613(unused-argument), ListPackagesAction.execute] Unused argument 'opt'
elbepack/soapclient.py:810: [W0613(unused-argument), DownloadAction.execute] Unused argument 'opt'
elbepack/soapclient.py:865: [W0613(unused-argument), UploadPackageAction.execute] Unused argument 'opt'
************* Module elbepack.hdimg
elbepack/hdimg.py:22: [W0613(unused-argument), mkfs_mtd] Unused argument 'rfs'
elbepack/hdimg.py:55: [W0612(unused-variable), mkfs_mtd] Unused variable 'e'
elbepack/hdimg.py:137: [W0612(unused-variable), build_image_mtd] Unused variable 'e'
************* Module elbepack.updatepkg
elbepack/updatepkg.py:28: [W0612(unused-variable), inlucdedir] Unused variable 'dn'
elbepack/updatepkg.py:67: [W0612(unused-variable), gen_update_pkg] Unused variable 'md5'
************* Module elbepack.projectmanager
elbepack/projectmanager.py:512: [W0613(unused-argument), ProjectManager.rm_log] Unused argument 'builddir'
************* Module elbepack.asciidoclog
elbepack/asciidoclog.py:56: [W0612(unused-variable), LogBase.do] Unused variable 'out'
************* Module elbepack.pbuilderaction
elbepack/pbuilderaction.py:65: [W0612(unused-variable), CreateAction.execute] Unused variable 'tmp'
elbepack/pbuilderaction.py:64: [W0613(unused-argument), CreateAction.execute] Unused argument 'args'
elbepack/pbuilderaction.py:77: [W0612(unused-variable), CreateAction.execute] Unused variable 'msg'
elbepack/pbuilderaction.py:129: [W0613(unused-argument), UpdateAction.execute] Unused argument 'args'
elbepack/pbuilderaction.py:161: [W0613(unused-argument), BuildAction.execute] Unused argument 'args'
************* Module elbepack.rfs
elbepack/rfs.py:201: [W0612(unused-variable), BuildEnv.import_keys] Unused variable 'name'
************* Module elbepack.dump
elbepack/dump.py:227: [W0612(unused-variable), elbe_report] Unused variable 'realpath'
************* Module elbepack.virtapt
elbepack/virtapt.py:136: [W0613(unused-argument), VirtApt.pulse] Unused argument 'obj'
elbepack/virtapt.py:197: [W0612(unused-variable), VirtApt.setup_gpg] Unused variable 'e'
elbepack/virtapt.py:236: [W0613(unused-argument), VirtApt.get_uri] Unused argument 'suite'
elbepack/virtapt.py:236: [W0613(unused-argument), VirtApt.get_uri] Unused argument 'arch'
************* Module elbepack.gpg
elbepack/gpg.py:207: [W0612(unused-variable), export_key] Unused variable 'ex'
************* Module elbepack.dbaction
elbepack/dbaction.py:55: [W0612(unused-variable), InitAction.execute] Unused variable 'arg'
elbepack/dbaction.py:157: [W0613(unused-argument), ListProjectsAction.execute] Unused argument 'args'
elbepack/dbaction.py:175: [W0613(unused-argument), ListUsersAction.execute] Unused argument 'args'
************* Module elbepack.licencexml
elbepack/licencexml.py:93: [W0612(unused-variable), copyright_xml.add_copyright_file] Unused variable 'e'
************* Module elbepack.db
elbepack/db.py:433: [W0612(unused-variable), ElbeDB.load_project] Unused variable 'e'
elbepack/db.py:768: [W0612(unused-variable), ElbeDB.add_project_file] Unused variable 'p'
************* Module elbepack.pkgarchive
elbepack/pkgarchive.py:69: [W0612(unused-variable), gen_binpkg_archive] Unused variable 've'
elbepack/pkgarchive.py:73: [W0612(unused-variable), gen_binpkg_archive] Unused variable 'fe'
elbepack/pkgarchive.py:81: [W0612(unused-variable), gen_binpkg_archive] Unused variable 'te'
************* Module elbepack.xmldefaults
elbepack/xmldefaults.py:164: [W0612(unused-variable), get_random_mac] Unused variable 'i'
************* Module elbepack.commands.bootup-check
elbepack/commands/bootup-check.py:55: [W0613(unused-argument), run_command] Unused argument 'argv'
************* Module elbepack.commands.daemon
elbepack/commands/daemon.py:38: [W0612(unused-variable), run_command] Unused variable 'args'
elbepack/commands/daemon.py:49: [W0612(unused-variable), run_command] Unused variable 'mod'
************* Module elbepack.commands.updated
elbepack/commands/updated.py:27: [W0613(unused-argument), shutdown] Unused argument 'fname'
elbepack/commands/updated.py:27: [W0613(unused-argument), shutdown] Unused argument 'signum'
elbepack/commands/updated.py:65: [W0612(unused-variable), run_command] Unused variable 'args'
************* Module elbepack.commands.debianize
elbepack/commands/debianize.py:15: [W0613(unused-argument), run_command] Unused argument 'args'
************* Module elbepack.commands.get_archive
elbepack/commands/get_archive.py:28: [W0612(unused-variable), run_command] Unused variable 'opt'
************* Module elbepack.commands.parselicence
elbepack/commands/parselicence.py:172: [W0612(unused-variable), run_command] Unused variable 'unknown_licenses'
************* Module elbepack.commands.toolchainextract
elbepack/commands/toolchainextract.py:29: [W0612(unused-variable), run_command] Unused variable 'args'
************* Module elbepack.commands.add
elbepack/commands/add.py:18: [W0612(unused-variable), run_command] Unused variable 'opt'
************* Module elbepack.commands.diff
elbepack/commands/diff.py:22: [W0612(unused-variable), walk_generated] Unused variable 'dirs'
elbepack/commands/diff.py:77: [W0612(unused-variable), walk_fixed] Unused variable 'dirs'
elbepack/commands/diff.py:136: [W0612(unused-variable), run_command] Unused variable 'fileline'
************* Module elbepack.commands.validate
elbepack/commands/validate.py:42: [W0612(unused-variable), run_command] Unused variable 'xml'
************* Module elbepack.commands.setsel
elbepack/commands/setsel.py:40: [W0612(unused-variable), run_command] Unused variable 'opt'
************* Module elbepack.daemons.soap.esoap
elbepack/daemons/soap/esoap.py:76: [W0613(unused-argument), ESoap.get_files] Unused argument 'uid'
elbepack/daemons/soap/esoap.py:115: [W0613(unused-argument), ESoap.get_file] Unused argument 'uid'
elbepack/daemons/soap/esoap.py:290: [W0613(unused-argument), ESoap.reset_project] Unused argument 'uid'
elbepack/daemons/soap/esoap.py:314: [W0613(unused-argument), ESoap.new_project] Unused argument 'url_validation'
elbepack/daemons/soap/esoap.py:333: [W0613(unused-argument), ESoap.shutdown_initvm] Unused argument 'uid'
elbepack/daemons/soap/esoap.py:346: [W0613(unused-argument), ESoap.list_packages] Unused argument 'uid'
elbepack/daemons/soap/esoap.py:348: [W0612(unused-variable), ESoap.list_packages] Unused variable 'dirnames'
elbepack/daemons/soap/esoap.py:348: [W0612(unused-variable), ESoap.list_packages] Unused variable 'root'
************* Module elbepack.daemons.soap
elbepack/daemons/soap/__init__.py:48: [W0612(unused-variable), MySession.__call__] Unused variable 'f'
------------------------------------------------------------------------------------------------------------------

The fixes here consist mainly of 3 cases:

1) x,y = get_tuple()  # x unused
   convert to:
   _,y = get_tuple()

2) Interface has more parameters than implemention uses.
   (iE. finetuning action uses either target or buildenv param)
   fix it by marking unused parameter with _

3) except Exception as e:
      # does not use e
   convert to:
   except Exception

After this patch there are still unused args/vars, but these
messages point to real errors, that need to be fixed separately.
Or some unused argument requires that the signature of a function
is changed.

-------------------------------------------------------------------------------------------------------------------
************* Module elbepack.elbeproject
elbepack/elbeproject.py:406: [W0613(unused-argument), ElbeProject.build] Unused argument 'skip_debootstrap'
elbepack/elbeproject.py:407: [W0613(unused-argument), ElbeProject.build] Unused argument 'debug'
************* Module elbepack.rpcaptcache
elbepack/rpcaptcache.py:148: [W0613(unused-argument), RPCAPTCache.mark_delete] Unused argument 'version'
elbepack/rpcaptcache.py:152: [W0613(unused-argument), RPCAPTCache.mark_keep] Unused argument 'version'
************* Module elbepack.pbuilder
elbepack/pbuilder.py:13: [W0613(unused-argument), pbuilder_ensure_chroot] Unused argument 'builddir'
************* Module elbepack.updated
elbepack/updated.py:178: [W0612(unused-variable), rw_access.__exit__] Unused variable 'ret'
elbepack/updated.py:582: [W0613(unused-argument), shutdown] Unused argument 'fname'
elbepack/updated.py:582: [W0613(unused-argument), shutdown] Unused argument 'signum'
************* Module elbepack.repomanager
elbepack/repomanager.py:224: [W0613(unused-argument), RepoBase._removedeb] Unused argument 'component'
elbepack/repomanager.py:232: [W0613(unused-argument), RepoBase._removesrc] Unused argument 'component'
elbepack/repomanager.py:335: [W0613(unused-argument), CdromInitRepo.__init__] Unused argument 'arch'
************* Module elbepack.pkgutils
elbepack/pkgutils.py:231: [W0612(unused-variable), download_pkg] Unused variable 'e'
************* Module elbepack.efilesystem
elbepack/efilesystem.py:333: [W0612(unused-variable), TargetFs.part_target] Unused variable 'oldwd'
elbepack/efilesystem.py:343: [W0612(unused-variable), TargetFs.part_target] Unused variable 'e'
************* Module elbepack.asyncworker
elbepack/asyncworker.py:27: [W0613(unused-argument), AsyncWorkerJob.enqueue] Unused argument 'db'
************* Module elbepack.soapclient
elbepack/soapclient.py:189: [W0613(unused-argument), AddUserAction.execute] Unused argument 'opt'
************* Module elbepack.hdimg
elbepack/hdimg.py:22: [W0613(unused-argument), mkfs_mtd] Unused argument 'rfs'
************* Module elbepack.updatepkg
elbepack/updatepkg.py:67: [W0612(unused-variable), gen_update_pkg] Unused variable 'md5'
************* Module elbepack.projectmanager
elbepack/projectmanager.py:512: [W0613(unused-argument), ProjectManager.rm_log] Unused argument 'builddir'
************* Module elbepack.virtapt
elbepack/virtapt.py:236: [W0613(unused-argument), VirtApt.get_uri] Unused argument 'suite'
elbepack/virtapt.py:236: [W0613(unused-argument), VirtApt.get_uri] Unused argument 'arch'
************* Module elbepack.db
elbepack/db.py:768: [W0612(unused-variable), ElbeDB.add_project_file] Unused variable 'p'
************* Module elbepack.pkgarchive
elbepack/pkgarchive.py:81: [W0612(unused-variable), gen_binpkg_archive] Unused variable 'te'
************* Module elbepack.commands.bootup-check
elbepack/commands/bootup-check.py:55: [W0613(unused-argument), run_command] Unused argument 'argv'
************* Module elbepack.commands.updated
elbepack/commands/updated.py:27: [W0613(unused-argument), shutdown] Unused argument 'fname'
elbepack/commands/updated.py:27: [W0613(unused-argument), shutdown] Unused argument 'signum'
************* Module elbepack.daemons.soap.esoap
elbepack/daemons/soap/esoap.py:76: [W0613(unused-argument), ESoap.get_files] Unused argument 'uid'
elbepack/daemons/soap/esoap.py:115: [W0613(unused-argument), ESoap.get_file] Unused argument 'uid'
elbepack/daemons/soap/esoap.py:290: [W0613(unused-argument), ESoap.reset_project] Unused argument 'uid'
elbepack/daemons/soap/esoap.py:314: [W0613(unused-argument), ESoap.new_project] Unused argument 'url_validation'
elbepack/daemons/soap/esoap.py:333: [W0613(unused-argument), ESoap.shutdown_initvm] Unused argument 'uid'
elbepack/daemons/soap/esoap.py:346: [W0613(unused-argument), ESoap.list_packages] Unused argument 'uid'
-------------------------------------------------------------------------------------------------------------------

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/archivedir.py                |  4 ++--
 elbepack/asciidoclog.py               |  2 +-
 elbepack/asyncworker.py               | 14 +++++------
 elbepack/commands/add.py              |  2 +-
 elbepack/commands/daemon.py           |  4 ++--
 elbepack/commands/debianize.py        |  2 +-
 elbepack/commands/diff.py             |  5 ++--
 elbepack/commands/get_archive.py      |  2 +-
 elbepack/commands/parselicence.py     |  1 -
 elbepack/commands/setsel.py           |  2 +-
 elbepack/commands/toolchainextract.py |  2 +-
 elbepack/commands/updated.py          |  2 +-
 elbepack/commands/validate.py         |  2 +-
 elbepack/daemons/soap/esoap.py        |  2 +-
 elbepack/db.py                        |  8 +++----
 elbepack/dbaction.py                  |  6 ++---
 elbepack/dump.py                      |  2 +-
 elbepack/efilesystem.py               |  2 +-
 elbepack/elbeproject.py               |  4 ++--
 elbepack/finetuning.py                | 38 +++++++++++++++---------------
 elbepack/gpg.py                       |  2 +-
 elbepack/hdimg.py                     |  4 ++--
 elbepack/initvmaction.py              | 22 +++++++++---------
 elbepack/licencexml.py                |  2 +-
 elbepack/pbuilder.py                  |  2 +-
 elbepack/pbuilderaction.py            |  9 ++++---
 elbepack/pkgarchive.py                |  6 ++---
 elbepack/pkgutils.py                  |  4 ++--
 elbepack/rfs.py                       |  1 -
 elbepack/soapclient.py                | 44 +++++++++++++++++------------------
 elbepack/updated.py                   | 10 ++++----
 elbepack/updatepkg.py                 |  2 +-
 elbepack/virtapt.py                   |  4 ++--
 elbepack/xmldefaults.py               |  2 +-
 elbepack/ziparchives.py               |  2 +-
 35 files changed, 108 insertions(+), 114 deletions(-)

diff --git a/elbepack/archivedir.py b/elbepack/archivedir.py
index 14df26f2..e4666e3e 100644
--- a/elbepack/archivedir.py
+++ b/elbepack/archivedir.py
@@ -79,7 +79,7 @@ def get_and_append_local(url, tararchive, keep):
         raise ArchivedirError(msg)
     collect(tararchive, prepare_path(url), keep)
 
-def get_and_append_unknown(url, archive):
+def get_and_append_unknown(url, _archive):
     msg = "unhandled scheme \"{}://\"".format(urlparse(url).scheme)
     raise NotImplementedError(msg)
 
@@ -101,7 +101,7 @@ def _combinearchivedir(xml):
             get_and_append = get_and_append_method(archiveurl)
             get_and_append(archiveurl, archive, keep)
             archivedir.getparent().remove(archivedir)
-        except (CalledProcessError, OSError) as ex:
+        except (CalledProcessError, OSError):
             msg = "Failure while processing \"" + archivedir.text + "\":\n"
             msg += str(sys.exc_info()[1])
             raise ArchivedirError(msg)
diff --git a/elbepack/asciidoclog.py b/elbepack/asciidoclog.py
index bcd55e7d..0c3b65eb 100644
--- a/elbepack/asciidoclog.py
+++ b/elbepack/asciidoclog.py
@@ -53,7 +53,7 @@ class LogBase(object):
             self.printo("running cmd +%s with STDIN %s+" % (cmd, stdin))
 
         self.verbatim_start()
-        ret, out = command_out(cmd, stdin=stdin, output=self.fp)
+        ret, _ = command_out(cmd, stdin=stdin, output=self.fp)
         self.verbatim_end()
 
         if ret != 0:
diff --git a/elbepack/asyncworker.py b/elbepack/asyncworker.py
index d4d00ccd..9f94df86 100644
--- a/elbepack/asyncworker.py
+++ b/elbepack/asyncworker.py
@@ -49,7 +49,7 @@ class BuildSysrootJob(AsyncWorkerJob):
             db.update_project_files(self.project)
             self.project.log.printo("Build finished successfully")
             db.reset_busy(self.project.builddir, "build_done")
-        except Exception as e:
+        except Exception:
             db.update_project_files(self.project)
             self.project.log.printo("Build sysroot failed")
             self.project.log.printo(traceback.format_exc())
@@ -74,7 +74,7 @@ class BuildSDKJob(AsyncWorkerJob):
             db.update_project_files(self.project)
             self.project.log.printo("Build finished successfully")
             db.reset_busy(self.project.builddir, "build_done")
-        except Exception as e:
+        except Exception:
             db.update_project_files(self.project)
             self.project.log.printo("Build SDK failed")
             self.project.log.printo(traceback.format_exc())
@@ -101,7 +101,7 @@ class BuildCDROMsJob(AsyncWorkerJob):
             db.update_project_files(self.project)
             self.project.log.printo("Build finished successfully")
             db.reset_busy(self.project.builddir, "build_done")
-        except Exception as e:
+        except Exception:
             db.update_project_files(self.project)
             self.project.log.printo("Build CDROMs failed")
             self.project.log.printo(traceback.format_exc())
@@ -125,7 +125,7 @@ class BuildChrootTarJob(AsyncWorkerJob):
             db.update_project_files(self.project)
             self.project.log.printo("Build finished successfully")
             db.reset_busy(self.project.builddir, "build_done")
-        except Exception as e:
+        except Exception:
             db.update_project_files(self.project)
             self.project.log.printo("Build chrroot tarball failed")
             self.project.log.printo(traceback.format_exc())
@@ -230,7 +230,7 @@ class PdebuildJob(AsyncWorkerJob):
             db.update_project_files(self.project)
             self.project.log.printo("Pdeb finished successfully")
             db.reset_busy(self.project.builddir, "build_done")
-        except Exception as e:
+        except Exception:
             db.update_project_files(self.project)
             self.project.log.printo("Pdebuild failed")
             self.project.log.printo(traceback.format_exc())
@@ -256,7 +256,7 @@ class CreatePbuilderJob(AsyncWorkerJob):
             db.update_project_files(self.project)
             self.project.log.printo("Pbuilder finished successfully")
             db.reset_busy(self.project.builddir, "build_done")
-        except Exception as e:
+        except Exception:
             db.update_project_files(self.project)
             self.project.log.printo("Pbuilder failed")
             self.project.log.printo(traceback.format_exc())
@@ -280,7 +280,7 @@ class UpdatePbuilderJob(AsyncWorkerJob):
             self.project.update_pbuilder()
             self.project.log.printo("Updating Pbuilder finished successfully")
             db.reset_busy(self.project.builddir, "build_done")
-        except Exception as e:
+        except Exception:
             db.update_project_files(self.project)
             self.project.log.printo("update Pbuilder failed")
             self.project.log.printo(traceback.format_exc())
diff --git a/elbepack/commands/add.py b/elbepack/commands/add.py
index 0aa192f3..a038b78c 100644
--- a/elbepack/commands/add.py
+++ b/elbepack/commands/add.py
@@ -15,7 +15,7 @@ def run_command(argv):
 
     oparser = OptionParser(
         usage="usage: %prog add [options] <xmlfile> <pkg1> [pkgN]")
-    (opt, args) = oparser.parse_args(argv)
+    (_, args) = oparser.parse_args(argv)
 
     if len(args) < 2:
         print("Wrong number of arguments")
diff --git a/elbepack/commands/daemon.py b/elbepack/commands/daemon.py
index f8530a93..8a06b4ab 100644
--- a/elbepack/commands/daemon.py
+++ b/elbepack/commands/daemon.py
@@ -35,7 +35,7 @@ def run_command(argv):
         oparser.add_option("--" + str(d), dest=str(d), default=False,
                            action="store_true", help="enable " + str(d))
 
-    (opt, args) = oparser.parse_args(argv)
+    (opt, _) = oparser.parse_args(argv)
 
     active = False
 
@@ -46,7 +46,7 @@ def run_command(argv):
                     active = True
                     print("enable %s" % str(d))
                     module = "elbepack.daemons." + str(d)
-                    mod = __import__(module)
+                    _ = __import__(module)
                     cmdmod = sys.modules[module]
                     cherrypy.tree.graft(
                         cmdmod.get_app(
diff --git a/elbepack/commands/debianize.py b/elbepack/commands/debianize.py
index 3520f2ff..ad38a8ca 100644
--- a/elbepack/commands/debianize.py
+++ b/elbepack/commands/debianize.py
@@ -12,7 +12,7 @@ import sys
 from elbepack.debianize.debianize import Debianize, DebianizeBase
 
 
-def run_command(args):
+def run_command(_args):
     if os.path.exists('debian'):
         print("debian folder already exists, nothing to do")
         sys.exit(10)
diff --git a/elbepack/commands/diff.py b/elbepack/commands/diff.py
index 63cc0055..3f2dd85e 100644
--- a/elbepack/commands/diff.py
+++ b/elbepack/commands/diff.py
@@ -19,7 +19,7 @@ def walk_generated(gen_path, fix_path, exclude):
     gen_path = gen_path.rstrip("/")
     fix_path = fix_path.rstrip("/")
 
-    for root, dirs, files in os.walk(gen_path):
+    for root, _, files in os.walk(gen_path):
         if root == gen_path:
             infs_root = "/"
         else:
@@ -74,7 +74,7 @@ def walk_fixed(gen_path, fix_path, exclude):
     gen_path = gen_path.rstrip("/")
     fix_path = fix_path.rstrip("/")
 
-    for root, dirs, files in os.walk(fix_path):
+    for root, _, files in os.walk(fix_path):
         if root == fix_path:
             infs_root = "/"
         else:
@@ -133,6 +133,5 @@ def run_command(argv):
 
     print("")
 
-    fileline = ""
     for f in differ + only:
         print("tar rf archive.tar -C %s %s" % (fix_rfs, f))
diff --git a/elbepack/commands/get_archive.py b/elbepack/commands/get_archive.py
index 796a76ab..7838b940 100644
--- a/elbepack/commands/get_archive.py
+++ b/elbepack/commands/get_archive.py
@@ -25,7 +25,7 @@ def run_command(argv):
 
     oparser = OptionParser(
         usage="usage: %prog get_archive <xmlfile> <archive>")
-    (opt, args) = oparser.parse_args(argv)
+    (_, args) = oparser.parse_args(argv)
 
     if len(args) != 2:
         print("Wrong number of arguments")
diff --git a/elbepack/commands/parselicence.py b/elbepack/commands/parselicence.py
index e3b27e76..e84ea3e5 100644
--- a/elbepack/commands/parselicence.py
+++ b/elbepack/commands/parselicence.py
@@ -169,7 +169,6 @@ def run_command(argv):
 
     mapping = license_dep5_to_spdx(opt.mapping)
 
-    unknown_licenses = []
     # Dont use direct iterator, because we might want to delete
     # elements, when --errors-only is active
     for pkg in list(tree.root):
diff --git a/elbepack/commands/setsel.py b/elbepack/commands/setsel.py
index 467582b0..f33bfc01 100644
--- a/elbepack/commands/setsel.py
+++ b/elbepack/commands/setsel.py
@@ -37,7 +37,7 @@ def parse_selections(fname):
 def run_command(argv):
 
     oparser = OptionParser(usage="usage: %prog setsel <xmlfile> <pkglist.txt>")
-    (opt, args) = oparser.parse_args(argv)
+    (_, args) = oparser.parse_args(argv)
 
     if len(args) != 2:
         print("Wrong number of arguments")
diff --git a/elbepack/commands/toolchainextract.py b/elbepack/commands/toolchainextract.py
index dcc82dab..aaf26ac2 100644
--- a/elbepack/commands/toolchainextract.py
+++ b/elbepack/commands/toolchainextract.py
@@ -26,7 +26,7 @@ def run_command(argv):
                        help="distro codename for repository")
     oparser.add_option("-b", "--buildtype", dest="buildtype",
                        help="Override the buildtype")
-    (opt, args) = oparser.parse_args(argv)
+    (opt, _) = oparser.parse_args(argv)
 
     if not opt.path:
         oparser.print_help()
diff --git a/elbepack/commands/updated.py b/elbepack/commands/updated.py
index 38fc3a9a..2f8c3337 100644
--- a/elbepack/commands/updated.py
+++ b/elbepack/commands/updated.py
@@ -62,7 +62,7 @@ def run_command(argv):
                        default=False,
                        help="monitor USB devices")
 
-    (opt, args) = oparser.parse_args(argv)
+    (opt, _) = oparser.parse_args(argv)
 
     status.nosign = opt.nosign
     status.verbose = opt.verbose
diff --git a/elbepack/commands/validate.py b/elbepack/commands/validate.py
index 75ecca2f..2e254b1f 100644
--- a/elbepack/commands/validate.py
+++ b/elbepack/commands/validate.py
@@ -39,7 +39,7 @@ def run_command(argv):
 
     if opt.validate_urls:
         try:
-            xml = ElbeXML(args[0], url_validation=ValidationMode.CHECK_ALL)
+            ElbeXML(args[0], url_validation=ValidationMode.CHECK_ALL)
         except ValidationError as e:
             print(e)
             sys.exit(20)
diff --git a/elbepack/daemons/soap/esoap.py b/elbepack/daemons/soap/esoap.py
index 102faef2..745b8a3a 100644
--- a/elbepack/daemons/soap/esoap.py
+++ b/elbepack/daemons/soap/esoap.py
@@ -345,7 +345,7 @@ class ESoap (ServiceBase):
     @soap_faults
     def list_packages(self, uid, builddir):
         s = ''
-        for root, dirnames, filenames in os.walk(
+        for _, _, filenames in os.walk(
                 os.path.join(builddir, "repo/pool/main")):
             for filename in fnmatch.filter(filenames, '*.deb'):
                 s += filename + '\n'
diff --git a/elbepack/db.py b/elbepack/db.py
index 9f6c0f29..fe03ec46 100644
--- a/elbepack/db.py
+++ b/elbepack/db.py
@@ -430,28 +430,28 @@ class ElbeDB(object):
         try:
             postbuild = self.get_project_file(builddir, 'postbuild.sh')
             postbuild_file = postbuild.builddir + '/' + postbuild.name
-        except ElbeDBError as e:
+        except ElbeDBError:
             pass
 
         presh_file = None
         try:
             presh_handle = self.get_project_file(builddir, 'pre.sh')
             presh_file = presh_handle.builddir + '/' + presh_handle.name
-        except ElbeDBError as e:
+        except ElbeDBError:
             pass
 
         postsh_file = None
         try:
             postsh_handle = self.get_project_file(builddir, 'post.sh')
             postsh_file = postsh_handle.builddir + '/' + postsh_handle.name
-        except ElbeDBError as e:
+        except ElbeDBError:
             pass
 
         savesh_file = None
         try:
             savesh_handle = self.get_project_file(builddir, 'save.sh')
             savesh_file = savesh_handle.builddir + '/' + savesh_handle.name
-        except ElbeDBError as e:
+        except ElbeDBError:
             pass
 
         with session_scope(self.session) as s:
diff --git a/elbepack/dbaction.py b/elbepack/dbaction.py
index a318f309..ef763644 100644
--- a/elbepack/dbaction.py
+++ b/elbepack/dbaction.py
@@ -52,7 +52,7 @@ class InitAction(DbAction):
         oparser.add_option("--noadmin", dest="admin", default=True,
                            action="store_false")
 
-        (opt, arg) = oparser.parse_args(args)
+        (opt, _) = oparser.parse_args(args)
 
         ElbeDB.init_db(opt.name, opt.fullname, opt.password,
                        opt.email, opt.admin)
@@ -154,7 +154,7 @@ class ListProjectsAction(DbAction):
     def __init__(self, node):
         DbAction.__init__(self, node)
 
-    def execute(self, args):
+    def execute(self, _args):
         db = ElbeDB()
         projects = db.list_projects()
 
@@ -172,7 +172,7 @@ class ListUsersAction(DbAction):
     def __init__(self, node):
         DbAction.__init__(self, node)
 
-    def execute(self, args):
+    def execute(self, _args):
         db = ElbeDB()
         users = db.list_users()
 
diff --git a/elbepack/dump.py b/elbepack/dump.py
index ce9eb11e..13fb811e 100644
--- a/elbepack/dump.py
+++ b/elbepack/dump.py
@@ -224,7 +224,7 @@ def elbe_report(xml, buildenv, cache, reportname, errorname, targetfs):
 
     tgt_pkg_list = set()
 
-    for fpath, realpath in targetfs.walk_files():
+    for fpath, _ in targetfs.walk_files():
         if fpath in index:
             pkg = index[fpath]
             tgt_pkg_list.add(pkg)
diff --git a/elbepack/efilesystem.py b/elbepack/efilesystem.py
index b75207a4..3366c97f 100644
--- a/elbepack/efilesystem.py
+++ b/elbepack/efilesystem.py
@@ -325,7 +325,7 @@ class TargetFs(ChRootFilesystem):
                 self.log.do(cmd % args)
                 # only append filename if creating tarball was successful
                 self.images.append(targz_name)
-            except CommandError as e:
+            except CommandError:
                 # error was logged; continue creating cpio image
                 pass
 
diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
index 0c9cd22b..30797c39 100644
--- a/elbepack/elbeproject.py
+++ b/elbepack/elbeproject.py
@@ -519,7 +519,7 @@ class ElbeProject (object):
             self.buildenv.rfs.write_licenses(
                 f, self.log, os.path.join(
                     self.builddir, "licence.xml"))
-        except Exception as e:
+        except Exception:
             self.log.printo("error during generating licence.txt/xml")
             self.log.printo(sys.exc_info()[0])
             lic_err = True
@@ -641,7 +641,7 @@ class ElbeProject (object):
 
             self.repo.include(os.path.join(self.builddir,
                                            "pbuilder", "result", "*.changes"))
-        except CommandError as e:
+        except CommandError:
             self.log.printo('')
             self.log.printo('Package fails to build.')
             self.log.printo('Please make sure, that the submitted package '
diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index 402de73e..11c448d8 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -43,7 +43,7 @@ class RmAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         files = target.glob(self.node.et.text)
 
         if 'exclude' in self.node.et.attrib:
@@ -68,7 +68,7 @@ class MkdirAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         log.do("mkdir -p " + target.fname(self.node.et.text))
 
 
@@ -82,7 +82,7 @@ class MknodAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         log.do(
             "mknod " +
             target.fname(
@@ -101,7 +101,7 @@ class BuildenvMkdirAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, buildenv, _target):
         log.do("mkdir -p " + buildenv.rfs.fname(self.node.et.text))
 
 
@@ -115,7 +115,7 @@ class CpAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         src = target.glob(self.node.et.attrib['path'])
         for f in src:
             log.do("cp -av " + f + " " + target.fname(self.node.et.text))
@@ -131,7 +131,7 @@ class BuildenvCpAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, buildenv, _target):
         src = buildenv.glob(self.node.et.attrib['path'])
         for f in src:
             log.do("cp -av " + f + " " + buildenv.rfs.fname(self.node.et.text))
@@ -179,7 +179,7 @@ class T2PMvAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         if self.node.et.text[0] == '/':
             dest = self.node.et.text[1:]
         else:
@@ -201,7 +201,7 @@ class MvAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         src = target.glob(self.node.et.attrib['path'])
         for f in src:
             log.do("mv -v " + f + " " + target.fname(self.node.et.text))
@@ -217,7 +217,7 @@ class LnAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         with target:
             log.chroot(
                 target.path, """/bin/sh -c 'ln -s %s "%s"' """ %
@@ -234,7 +234,7 @@ class BuildenvMvAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, buildenv, _target):
         src = buildenv.rfs.glob(self.node.et.attrib['path'])
         for f in src:
             log.do("mv -v " + f + " " + buildenv.rfs.fname(self.node.et.text))
@@ -250,7 +250,7 @@ class AddUserAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         with target:
             att = self.node.et.attrib
             options = ""
@@ -299,7 +299,7 @@ class AddGroupAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         with target:
             att = self.node.et.attrib
             # we use -f always
@@ -323,7 +323,7 @@ class RawCmdAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         with target:
             log.chroot(target.path, self.node.et.text)
 
@@ -338,7 +338,7 @@ class CmdAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         with target:
             log.chroot(target.path, "/bin/sh", stdin=self.node.et.text)
 
@@ -353,7 +353,7 @@ class BuildenvCmdAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, buildenv, _target):
         with buildenv:
             log.chroot(buildenv.path, "/bin/sh", stdin=self.node.et.text)
 
@@ -368,7 +368,7 @@ class PurgeAction(FinetuningAction):
     def __init__(self, node):
         FinetuningAction.__init__(self, node)
 
-    def execute(self, log, buildenv, target):
+    def execute(self, log, _buildenv, target):
         with target:
             log.chroot(target.path, "dpkg --purge " + self.node.et.text)
 
@@ -416,20 +416,20 @@ class UpdatedAction(FinetuningAction):
                 try:
                     cache.download_binary(
                         pkg.name, '/tmp/pkgs', pkg.installed_version)
-                except ValueError as ve:
+                except ValueError:
                     log.printo(
                         "No Package " +
                         pkg.name +
                         "-" +
                         pkg.installed_version)
-                except FetchError as fe:
+                except FetchError:
                     log.printo(
                         "Package " +
                         pkg.name +
                         "-" +
                         pkg.installed_version +
                         " could not be downloaded")
-                except TypeError as te:
+                except TypeError:
                     log.printo(
                         "Package " +
                         pkg.name +
diff --git a/elbepack/gpg.py b/elbepack/gpg.py
index b55d658b..af3081ae 100644
--- a/elbepack/gpg.py
+++ b/elbepack/gpg.py
@@ -204,7 +204,7 @@ def export_key(fingerprint, outfile):
 
     try:
         ctx.export(fingerprint, outfile)
-    except Exception as ex:
+    except Exception:
         print("Error exporting key %s" % (fingerprint))
 
     return '/var/cache/elbe/gnupg/pubring.gpg'
diff --git a/elbepack/hdimg.py b/elbepack/hdimg.py
index 5434734e..d5f64958 100644
--- a/elbepack/hdimg.py
+++ b/elbepack/hdimg.py
@@ -52,7 +52,7 @@ def mkfs_mtd(outf, mtd, fslabel, rfs, target):
                 fslabel[label].mkfsopt))
             # only append the ubifs file if creation didn't fail
             img_files.append("%s.ubifs" % label)
-        except CommandError as e:
+        except CommandError:
             # continue creating further ubifs filesystems
             pass
 
@@ -134,7 +134,7 @@ def build_image_mtd(outf, mtd, target):
         # only add file to list if ubinize command was successful
         img_files.append(mtd.text("name"))
 
-    except CommandError as e:
+    except CommandError:
         # continue with generating further images
         pass
 
diff --git a/elbepack/initvmaction.py b/elbepack/initvmaction.py
index 73cd55ae..041d6549 100644
--- a/elbepack/initvmaction.py
+++ b/elbepack/initvmaction.py
@@ -125,7 +125,7 @@ class StartAction(InitVMAction):
     def __init__(self, node):
         InitVMAction.__init__(self, node)
 
-    def execute(self, initvmdir, opt, args):
+    def execute(self, _initvmdir, _opt, _args):
         if self.initvm_state() == 1:
             print('Initvm already running.')
             sys.exit(20)
@@ -135,7 +135,7 @@ class StartAction(InitVMAction):
             # Wait five seconds for the initvm to boot
             # TODO: Instead of waiting for five seconds
             # check whether SOAP server is reachable.
-            for i in range(1, 5):
+            for _ in range(1, 5):
                 sys.stdout.write("*")
                 sys.stdout.flush()
                 time.sleep(1)
@@ -152,7 +152,7 @@ class EnsureAction(InitVMAction):
     def __init__(self, node):
         InitVMAction.__init__(self, node)
 
-    def execute(self, initvmdir, opt, args):
+    def execute(self, _initvmdir, _opt, _args):
         if self.initvm_state() == 5:
             system('%s initvm start' % elbe_exe)
         elif self.initvm_state() == 1:
@@ -172,7 +172,7 @@ class StopAction(InitVMAction):
     def __init__(self, node):
         InitVMAction.__init__(self, node)
 
-    def execute(self, initvmdir, opt, args):
+    def execute(self, _initvmdir, _opt, _args):
         if self.initvm_state() != 1:
             print('Initvm is not running.')
             sys.exit(20)
@@ -203,7 +203,7 @@ class AttachAction(InitVMAction):
     def __init__(self, node):
         InitVMAction.__init__(self, node)
 
-    def execute(self, initvmdir, opt, args):
+    def execute(self, _initvmdir, _opt, _args):
         if self.initvm_state() != 1:
             print('Error: Initvm not running properly.')
             sys.exit(20)
@@ -222,11 +222,11 @@ class StartBuildAction(InitVMAction):
     def __init__(self, node):
         InitVMAction.__init__(self, node)
 
-    def execute(self, initvmdir, opt, args):
+    def execute(self, initvmdir, _opt, _args):
         try:
             have_session = os.system(
                 "tmux has-session -t ElbeInitVMSession >/dev/null 2>&1")
-        except CommandError as e:
+        except CommandError:
             print("tmux exec failed, tmux version 1.9 or higher is required")
             sys.exit(20)
         if have_session != 256:
@@ -424,7 +424,7 @@ class CreateAction(InitVMAction):
             prjdir = prjdir.strip()
 
             cmd = '%s control set_xml %s %s' % (elbe_exe, prjdir, xmlfile)
-            ret, msg, err = command_out_stderr(cmd)
+            ret, _, err = command_out_stderr(cmd)
             if ret != 0:
                 print("elbe control set_xml failed.", file=sys.stderr)
                 print(err, file=sys.stderr)
@@ -546,7 +546,7 @@ class SubmitAction(InitVMAction):
     def __init__(self, node):
         InitVMAction.__init__(self, node)
 
-    def execute(self, initvmdir, opt, args):
+    def execute(self, _initvmdir, opt, args):
         try:
             system('%s initvm ensure' % elbe_exe)
         except CommandError:
@@ -612,7 +612,7 @@ class SubmitAction(InitVMAction):
 
             outxml = NamedTemporaryFile(prefix='elbe', suffix='xml')
             cmd = '%s preprocess -o %s %s' % (elbe_exe, outxml.name, xmlfile)
-            ret, msg, err = command_out_stderr(cmd)
+            ret, _, err = command_out_stderr(cmd)
             if ret != 0:
                 print("elbe preprocess failed.", file=sys.stderr)
                 print(err, file=sys.stderr)
@@ -631,7 +631,7 @@ class SubmitAction(InitVMAction):
             prjdir = prjdir.strip()
 
             cmd = '%s control set_xml %s %s' % (elbe_exe, prjdir, xmlfile)
-            ret, msg, err = command_out_stderr(cmd)
+            ret, _, err = command_out_stderr(cmd)
             if ret != 0:
                 print("elbe control set_xml failed2", file=sys.stderr)
                 print(err, file=sys.stderr)
diff --git a/elbepack/licencexml.py b/elbepack/licencexml.py
index 5a346472..94917870 100644
--- a/elbepack/licencexml.py
+++ b/elbepack/licencexml.py
@@ -90,7 +90,7 @@ class copyright_xml (object):
 
             return
 
-        except Exception as e:
+        except Exception:
             pass
 
         bytesio.seek(0)
diff --git a/elbepack/pbuilder.py b/elbepack/pbuilder.py
index a3bf4c72..c101b285 100644
--- a/elbepack/pbuilder.py
+++ b/elbepack/pbuilder.py
@@ -14,7 +14,7 @@ def pbuilder_ensure_chroot(builddir):
     pass
 
 
-def pbuilder_write_config(builddir, xml, log):
+def pbuilder_write_config(builddir, xml, _log):
     distname = xml.prj.text('suite')
     pbuilderrc_fname = os.path.join(builddir, "pbuilderrc")
     fp = open(pbuilderrc_fname, "w")
diff --git a/elbepack/pbuilderaction.py b/elbepack/pbuilderaction.py
index f6656050..574f0f47 100644
--- a/elbepack/pbuilderaction.py
+++ b/elbepack/pbuilderaction.py
@@ -61,8 +61,7 @@ class CreateAction(PBuilderAction):
     def __init__(self, node):
         PBuilderAction.__init__(self, node)
 
-    def execute(self, opt, args):
-        tmp = TmpdirFilesystem()
+    def execute(self, opt, _args):
 
         if opt.xmlfile:
             ret, prjdir, err = command_out_stderr(
@@ -74,7 +73,7 @@ class CreateAction(PBuilderAction):
                 sys.exit(20)
 
             prjdir = prjdir.strip()
-            ret, msg, err = command_out_stderr(
+            ret, _, err = command_out_stderr(
                 '%s control set_xml "%s" "%s"' %
                 (elbe_exe, prjdir, opt.xmlfile))
 
@@ -126,7 +125,7 @@ class UpdateAction(PBuilderAction):
     def __init__(self, node):
         PBuilderAction.__init__(self, node)
 
-    def execute(self, opt, args):
+    def execute(self, opt, _args):
 
         if not opt.project:
             print("you need to specify --project option", file=sys.stderr)
@@ -158,7 +157,7 @@ class BuildAction(PBuilderAction):
     def __init__(self, node):
         PBuilderAction.__init__(self, node)
 
-    def execute(self, opt, args):
+    def execute(self, opt, _args):
         tmp = TmpdirFilesystem()
 
         if opt.xmlfile:
diff --git a/elbepack/pkgarchive.py b/elbepack/pkgarchive.py
index a34e67b4..6c687fbb 100644
--- a/elbepack/pkgarchive.py
+++ b/elbepack/pkgarchive.py
@@ -66,11 +66,11 @@ def gen_binpkg_archive(ep, repodir):
                     abs_path = c.download_binary(pkg.name,
                                                  '/var/cache/elbe/pkgarchive',
                                                  pkg.installed_version)
-                except ValueError as ve:
+                except ValueError:
                     ep.log.printo("No Package " + pkg.name + "-" +
                                   pkg.installed_version)
                     raise
-                except FetchError as fe:
+                except FetchError:
                     ep.log.printo(
                         "Package " +
                         pkg.name +
@@ -78,7 +78,7 @@ def gen_binpkg_archive(ep, repodir):
                         pkg.installed_version +
                         " could not be downloaded")
                     raise
-                except TypeError as te:
+                except TypeError:
                     ep.log.printo(
                         "Package " +
                         pkg.name +
diff --git a/elbepack/pkgutils.py b/elbepack/pkgutils.py
index f109569a..ed6678e2 100644
--- a/elbepack/pkgutils.py
+++ b/elbepack/pkgutils.py
@@ -210,7 +210,7 @@ def download_pkg(prj,
         raise NoKinitrdException('no package %s available' % package)
     except SystemError:
         raise NoKinitrdException('a configured mirror is not reachable')
-    except CommandError as e:
+    except CommandError:
         raise NoKinitrdException("couldn't download package %s" % package)
 
     if not urilist:
@@ -228,7 +228,7 @@ def download_pkg(prj,
                 system('wget -O "%s" "%s"' % (dest, uri))
             else:
                 raise NoKinitrdException('could not retreive %s' % uri)
-        except CommandError as e:
+        except CommandError:
             raise NoKinitrdException("couldn't download package %s" % package)
 
         if len(sha256) > 0:
diff --git a/elbepack/rfs.py b/elbepack/rfs.py
index e2ad3ce3..b8c19a39 100644
--- a/elbepack/rfs.py
+++ b/elbepack/rfs.py
@@ -198,7 +198,6 @@ class BuildEnv ():
                 if url.has('key'):
                     keyurl = url.text('key').strip()    # URL to key
                     keyurl = keyurl.replace('LOCALMACHINE', '10.0.2.2')
-                    name = keyurl.split('/')[-1]        # Filename of key
 
                     myKey = urllib2.urlopen(keyurl).read()
                     self.log.do(
diff --git a/elbepack/soapclient.py b/elbepack/soapclient.py
index fbb29a97..0980992a 100644
--- a/elbepack/soapclient.py
+++ b/elbepack/soapclient.py
@@ -85,7 +85,7 @@ class ElbeSoapClient(object):
         while True:
             try:
                 ret = self.service.get_file(builddir, filename, part)
-            except BadStatusLine as e:
+            except BadStatusLine:
                 retry = retry - 1
                 if not retry:
                     fp.close()
@@ -131,7 +131,7 @@ class RemoveLogAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 1:
             print("usage: elbe control rm_log <project_dir>", file=sys.stderr)
             sys.exit(20)
@@ -150,7 +150,7 @@ class ListProjectsAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, _args):
         projects = client.service.list_projects()
 
         try:
@@ -171,7 +171,7 @@ class ListUsersAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, _args):
         users = client.service.list_users()
 
         for u in users.string:
@@ -219,7 +219,7 @@ class CreateProjectAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, _args):
 
         uuid = client.service.new_project()
         print(uuid)
@@ -235,7 +235,7 @@ class ResetProjectAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 1:
             print(
                 "usage: elbe control reset_project <project_dir>",
@@ -256,7 +256,7 @@ class DeleteProjectAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 1:
             print(
                 "usage: elbe control del_project <project_dir>",
@@ -277,7 +277,7 @@ class SetXmlAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 2:
             print(
                 "usage: elbe control set_xml <project_dir> <xml>",
@@ -292,7 +292,7 @@ class SetXmlAction(ClientAction):
                 filename,
                 skip_validate=True,
                 url_validation=ValidationMode.NO_CHECK)
-        except IOError as e:
+        except IOError:
             print("%s is not a valid elbe xml file" % filename)
             sys.exit(20)
 
@@ -355,7 +355,7 @@ class BuildSysrootAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 1:
             print(
                 "usage: elbe control build-sysroot <project_dir>",
@@ -376,7 +376,7 @@ class BuildSDKAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 1:
             print(
                 "usage: elbe control build-sdk <project_dir>",
@@ -455,7 +455,7 @@ class BuildChrootAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 1:
             print(
                 "usage: elbe control build_chroot_tarball <project_dir>",
@@ -477,7 +477,7 @@ class DumpFileAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 2:
             print(
                 "usage: elbe control dump_file <project_dir> <file>",
@@ -556,7 +556,7 @@ class WaitProjectBusyAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 1:
             print(
                 "usage: elbe control wait_busy <project_dir>",
@@ -604,7 +604,7 @@ class SetCdromAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         size = 1024 * 1024
 
         if len(args) != 2:
@@ -637,7 +637,7 @@ class SetOrigAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         size = 1024 * 1024
 
         if len(args) != 2:
@@ -671,7 +671,7 @@ class ShutdownInitvmAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 0:
             print("usage: elbe control shutdown_initvm", file=sys.stderr)
             sys.exit(20)
@@ -726,7 +726,7 @@ class BuildPbuilderAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 1:
             print(
                 "usage: elbe control build_pbuilder <project_dir>",
@@ -747,7 +747,7 @@ class UpdatePbuilderAction(ClientAction):
     def __init__(self, node):
         ClientAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 1:
             print(
                 "usage: elbe control update_pbuilder <project_dir>",
@@ -786,7 +786,7 @@ class ListPackagesAction(RepoAction):
     def __init__(self, node):
         RepoAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 1:
             print(
                 "usage: elbe prjrepo list_packages <project_dir>",
@@ -807,7 +807,7 @@ class DownloadAction(RepoAction):
     def __init__(self, node):
         RepoAction.__init__(self, node)
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 1:
             print("usage: elbe prjrepo download <project_dir>",
                   file=sys.stderr)
@@ -862,7 +862,7 @@ class UploadPackageAction(RepoAction):
                     print("Upload of package finished.")
                     break
 
-    def execute(self, client, opt, args):
+    def execute(self, client, _opt, args):
         if len(args) != 2:
             print(
                 "usage: elbe prjrepo upload_pkg <project_dir> <deb/dsc file>",
diff --git a/elbepack/updated.py b/elbepack/updated.py
index e914a90d..f5a3c426 100644
--- a/elbepack/updated.py
+++ b/elbepack/updated.py
@@ -458,8 +458,6 @@ def action_select(upd_file, status):
     with rw_access(prefix, status):
         for i in upd_file_z.namelist():
 
-            (dirname, filename) = os.path.split(i)
-
             try:
                 zi = upd_file_z.getinfo(i)
                 upd_file_z.extract(zi, prefix)
@@ -487,7 +485,7 @@ def action_select(upd_file, status):
 
     if os.path.isdir(prefix + "conf"):
         status.log("copying config files:")
-        for path, pathname, filenames in os.walk(prefix + "conf"):
+        for path, _, filenames in os.walk(prefix + "conf"):
             dst = path[len(prefix + "conf"):]
             with rw_access(dst, status):
                 for f in filenames:
@@ -505,7 +503,7 @@ def action_select(upd_file, status):
 
     if os.path.isdir(prefix + "cmd"):
         status.log("executing scripts:")
-        for path, pathname, filenames in os.walk(prefix + "cmd"):
+        for path, _, filenames in os.walk(prefix + "cmd"):
             for f in filenames:
                 cmd = os.path.join(path, f)
                 if os.path.isfile(cmd):
@@ -539,7 +537,7 @@ def action_select(upd_file, status):
 
 
 def is_update_file(upd_file):
-    root, extension = os.path.splitext(upd_file)
+    _, extension = os.path.splitext(upd_file)
     if extension == ".gpg":
         return True
 
@@ -560,7 +558,7 @@ update_lock = threading.Lock()
 def handle_update_file(upd_file, status, remove=False):
     with update_lock:
         status.log("checking file: " + str(upd_file))
-        root, extension = os.path.splitext(upd_file)
+        _, extension = os.path.splitext(upd_file)
 
         if extension == ".gpg":
             fname = unsign_file(upd_file)
diff --git a/elbepack/updatepkg.py b/elbepack/updatepkg.py
index 6ced00a2..39805b0a 100644
--- a/elbepack/updatepkg.py
+++ b/elbepack/updatepkg.py
@@ -25,7 +25,7 @@ def inlucdedir(destination, directory, source, mode=None):
     dst = destination + '/' + directory
     copytree(source, dst)
     if mode:
-        for dp, dn, fn in os.walk(dst):
+        for dp, _, fn in os.walk(dst):
             for f in fn:
                 p = os.path.join(dp, f)
                 os.chmod(p, mode)
diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index 6b077d14..5361278a 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -133,7 +133,7 @@ class VirtApt:
     def stop(self):
         pass
 
-    def pulse(self, obj):
+    def pulse(self, _obj):
         return True
 
     def mkdir_p(self, newdir, mode=0o755):
@@ -194,7 +194,7 @@ class VirtApt:
                 system('gpg %s --import "%s"' % (
                     gpg_options,
                     os.path.join("/etc/apt/trusted.gpg.d", key)))
-            except CommandError as e:
+            except CommandError:
                 print("adding elbe-pubkey to keyring failed")
 
     def add_pubkey_url(self, url):
diff --git a/elbepack/xmldefaults.py b/elbepack/xmldefaults.py
index bcd09c04..1c58b21d 100644
--- a/elbepack/xmldefaults.py
+++ b/elbepack/xmldefaults.py
@@ -161,7 +161,7 @@ defaults = {"armel": armel_defaults,
             "nodefaults": {}}
 
 def get_random_mac():
-    binaddr = [random.randint(0, 255) for i in range(6)]
+    binaddr = [random.randint(0, 255) for _ in range(6)]
     binaddr[0] &= 0xfe
     binaddr[0] |= 0x02
     s = ["%02x" % x for x in binaddr]
diff --git a/elbepack/ziparchives.py b/elbepack/ziparchives.py
index e2b74e27..a2b0b259 100644
--- a/elbepack/ziparchives.py
+++ b/elbepack/ziparchives.py
@@ -10,7 +10,7 @@ import os
 
 def create_zip_archive(zipfilename, path, inarchpath):
     with ZipFile(zipfilename, "w", ZIP_DEFLATED) as zf:
-        for root, dirs, files in os.walk(path):
+        for root, _, files in os.walk(path):
             archpath = os.path.join(inarchpath, os.path.relpath(root, path))
             zf.write(root, archpath)
             for f in files:
-- 
2.11.0




More information about the elbe-devel mailing list