pylint fix: unused variable warning

This commit is contained in:
Alexander Todorov 2017-10-12 14:24:14 +03:00 committed by Brian C. Lane
parent 15de3e1687
commit 7f5b492198
4 changed files with 7 additions and 10 deletions

View File

@ -267,9 +267,6 @@ def execWithCapture(command, argv, stdin = None, stderr = None, root=None,
def execWithCallback(command, argv, stdin = None, stdout = None,
stderr = None, echo = True, callback = None,
callback_data = None, root = '/'):
def chroot():
os.chroot(root)
def closefds ():
stdinclose()
stdoutclose()

View File

@ -151,7 +151,7 @@ def loop_waitfor(loop_dev, outfile):
Raise RuntimeError if it isn't setup after 5 tries.
"""
for x in xrange(0,5):
for _ in xrange(0,5):
runcmd(["udevadm", "settle", "--timeout", "300"])
## XXX Note that losetup --list output can be truncated to 64 bytes in some
## situations. Don't use it to lookup backing file, go the other way

View File

@ -53,10 +53,10 @@ def generate_module_info(moddir, outfile=None):
'eth':read_module_set("modules.networking")}
modinfo = list()
for root, dirs, files in os.walk(moddir):
for root, _dirs, files in os.walk(moddir):
for modtype, modset in modsets.items():
for mod in modset.intersection(files): # modules in this dir
(name, ext) = os.path.splitext(mod) # foo.ko -> (foo, .ko)
(name, _ext) = os.path.splitext(mod) # foo.ko -> (foo, .ko)
desc = module_desc(joinpaths(root,mod)) or "%s driver" % name
modinfo.append(dict(name=name, type=modtype, desc=desc))
@ -238,7 +238,7 @@ class TreeBuilder(object):
self.implantisomd5()
def implantisomd5(self):
for section, data in self.treeinfo_data.items():
for _section, data in self.treeinfo_data.items():
if 'boot.iso' in data:
iso = joinpaths(self.vars.outroot, data['boot.iso'])
runcmd(["implantisomd5", iso])
@ -296,7 +296,7 @@ def findkernels(root="/", kdir="boot"):
for kernel in kernels:
for f in bootfiles:
if f.endswith('-'+kernel.version+'.img'):
imgtype, rest = f.split('-',1)
imgtype, _rest = f.split('-',1)
# special backwards-compat case
if imgtype == 'initramfs':
imgtype = 'initrd'

View File

@ -22,7 +22,7 @@ def main(args):
# parse sourcedir and targetdir
sourcetree, targettree = {}, {}
for tree, dir in [[sourcetree, sourcedir], [targettree, targetdir]]:
for root, dnames, fnames in os.walk(dir):
for root, _dnames, fnames in os.walk(dir):
for fname in fnames:
fpath = os.path.join(root, fname)
rpath = fpath.replace(dir, "", 1)
@ -116,7 +116,7 @@ def main(args):
[(rpath, sizeinbytes, islink)]
# sort by size
for pkg, size in sorted(sizedict.items(), key=operator.itemgetter(1),
for pkg, _size in sorted(sizedict.items(), key=operator.itemgetter(1),
reverse=True):
for item in sorted(pkgdict[pkg]):