Update things to make pylint 1.5.1 happy

This commit is contained in:
Brian C. Lane 2015-12-16 11:53:38 -08:00
parent ceabb7e214
commit a3097b3085
5 changed files with 6 additions and 14 deletions

View File

@ -204,7 +204,7 @@ def umount(mnt, lazy=False, maxretry=3, retrysleep=1.0):
count += 1 count += 1
if count == maxretry: if count == maxretry:
raise raise
logger.warn("failed to unmount %s. retrying (%d/%d)...", logger.warning("failed to unmount %s. retrying (%d/%d)...",
mnt, count, maxretry) mnt, count, maxretry)
if logger.getEffectiveLevel() <= logging.DEBUG: if logger.getEffectiveLevel() <= logging.DEBUG:
fuser = execWithCapture("fuser", ["-vm", mnt]) fuser = execWithCapture("fuser", ["-vm", mnt])

View File

@ -185,8 +185,6 @@ class LoraxTemplateRunner(object):
If lorax is called with a debug repo find the corresponding debuginfo package If lorax is called with a debug repo find the corresponding debuginfo package
names and write them to /root/debubg-pkgs.log on the boot.iso names and write them to /root/debubg-pkgs.log on the boot.iso
""" """
# If any of the repos are debug repos then find the debuginfo packages
# and write their NVR's to a logfile for later use.
for repo in self.dbo.repos: for repo in self.dbo.repos:
repo = self.dbo.repos[repo] repo = self.dbo.repos[repo]
if any(True for url in repo.baseurl if "debug" in url): if any(True for url in repo.baseurl if "debug" in url):
@ -196,6 +194,7 @@ class LoraxTemplateRunner(object):
if repo.mirrorlist and "debug" in repo.mirrorlist: if repo.mirrorlist and "debug" in repo.mirrorlist:
break break
else: else:
# No debug repos
return return
available = self.dbo.sack.query().available() available = self.dbo.sack.query().available()

View File

@ -532,7 +532,7 @@ def make_livecd(opts, mount_dir, work_dir):
isolabel = opts.volid or "{0.name}-{0.version}-{1.basearch}".format(product, arch) isolabel = opts.volid or "{0.name}-{0.version}-{1.basearch}".format(product, arch)
if len(isolabel) > 32: if len(isolabel) > 32:
isolabel = isolabel[:32] isolabel = isolabel[:32]
log.warn("Truncating isolabel to 32 chars: %s", isolabel) log.warning("Truncating isolabel to 32 chars: %s", isolabel)
tb = TreeBuilder(product=product, arch=arch, domacboot=opts.domacboot, tb = TreeBuilder(product=product, arch=arch, domacboot=opts.domacboot,
inroot=mount_dir, outroot=work_dir, inroot=mount_dir, outroot=work_dir,

View File

@ -14,13 +14,6 @@ class LoraxLintConfig(PocketLintConfig):
FalsePositive(r"ImageMinimizer.remove_rpm.runCallback: Unused argument .*") FalsePositive(r"ImageMinimizer.remove_rpm.runCallback: Unused argument .*")
] ]
@property
def disabledOptions(self):
return [ "I0011", # Locally disabling %s
"W0511", # FIXME/TODO/XXX
"W0141", # Used builtin function %s
]
@property @property
def pylintPlugins(self): def pylintPlugins(self):
retval = super(LoraxLintConfig, self).pylintPlugins retval = super(LoraxLintConfig, self).pylintPlugins

View File

@ -34,8 +34,8 @@ data.basearch = data.arch.basearch
data.libdir = data.arch.libdir data.libdir = data.arch.libdir
def get_args(template): def get_args(template):
argspec = inspect.getargspec(template.module.render_body) sig = inspect.signature(template.module.render_body)
return set(argspec.args[1:]) # skip "context" return set(list(sig.parameters)[1:]) # skip "context"
def readtemplate(filename): def readtemplate(filename):
parser = LoraxTemplate(directories=['.']) parser = LoraxTemplate(directories=['.'])