[PATCH] Fix pylint issues on rhel7-branch of blivet.
Chris Lumens
clumens at redhat.com
Mon Jun 1 15:46:25 UTC 2015
---
blivet/formats/__init__.py | 4 +++-
scripts/makebumpver | 12 +++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/blivet/formats/__init__.py b/blivet/formats/__init__.py
index 9b9a729..55fc626 100644
--- a/blivet/formats/__init__.py
+++ b/blivet/formats/__init__.py
@@ -179,6 +179,8 @@ class DeviceFormat(ObjectID):
it via the 'device' kwarg to the :meth:`create` method.
"""
ObjectID.__init__(self)
+ self._device = None
+
self.device = kwargs.get("device")
self.uuid = kwargs.get("uuid")
self.exists = kwargs.get("exists")
@@ -294,7 +296,7 @@ class DeviceFormat(ObjectID):
def _setDevice(self, devspec):
if devspec and not devspec.startswith("/"):
raise ValueError("device must be a fully qualified path")
- self._device = devspec # pylint: disable=attribute-defined-outside-init
+ self._device = devspec
def _getDevice(self):
return self._device
diff --git a/scripts/makebumpver b/scripts/makebumpver
index fa805f7..45e6526 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -126,9 +126,9 @@ class MakeBumpVer:
ret = proc[0].strip('\n').split('\n')
if len(ret) == 1 and ret[0].find('@') != -1:
- ret = ret[0].split('@')[0]
+ ret = [ret[0].split('@')[0]]
elif len(ret) == 1:
- ret = ret[0]
+ ret = [ret[0]]
else:
ret = filter(lambda x: x != '', ret)
@@ -243,7 +243,7 @@ class MakeBumpVer:
if self.ignore and self.ignore != '':
for commit in self.ignore.split(','):
- lines = filter(lambda x: not x.startswith(commit), lines)
+ lines = filter(lambda x, c=commit: not x.startswith(c), lines)
rpm_log = []
bad_bump = False
@@ -255,11 +255,9 @@ class MakeBumpVer:
fields = line.split(' ')
commit = fields[0]
- summary = self._getCommitDetail(commit, "%s")
+ summary = self._getCommitDetail(commit, "%s")[0]
body = self._getCommitDetail(commit, "%b")
- if type(body) is not list:
- body = [body]
- author = self._getCommitDetail(commit, "%aE")
+ author = self._getCommitDetail(commit, "%aE")[0]
if self.rhel:
rhbz = set()
--
2.2.2
More information about the anaconda-patches
mailing list