backend/common/fileutils.py | 2 +-
backend/common/rhnConfig.py | 2 +-
backend/common/rhnTB.py | 2 +-
backend/common/rhnTranslate.py | 2 +-
backend/common/rhn_rpm.py | 4 ++--
rel-eng/packages/spacewalk-pylint | 2 +-
spacewalk/pylint/spacewalk-pylint.rc | 6 ++++--
spacewalk/pylint/spacewalk-pylint.spec | 16 ++++++++++++++--
8 files changed, 25 insertions(+), 11 deletions(-)
New commits:
commit 1f9236b1d0f0c27bf46eca0111a163cbf2c6d4fd
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Sep 30 10:36:32 2013 +0200
Automatic commit of package [spacewalk-pylint] release [0.12-1].
diff --git a/rel-eng/packages/spacewalk-pylint b/rel-eng/packages/spacewalk-pylint
index 253e245..0b47439 100644
--- a/rel-eng/packages/spacewalk-pylint
+++ b/rel-eng/packages/spacewalk-pylint
@@ -1 +1 @@
-0.11-1 spacewalk/pylint/
+0.12-1 spacewalk/pylint/
diff --git a/spacewalk/pylint/spacewalk-pylint.spec
b/spacewalk/pylint/spacewalk-pylint.spec
index deb898b..08ca96d 100644
--- a/spacewalk/pylint/spacewalk-pylint.spec
+++ b/spacewalk/pylint/spacewalk-pylint.spec
@@ -1,5 +1,5 @@
Name: spacewalk-pylint
-Version: 0.11
+Version: 0.12
Release: 1%{?dist}
Summary: Pylint configuration for spacewalk python packages
@@ -58,6 +58,9 @@ rm -rf %{buildroot}
%doc LICENSE
%changelog
+* Mon Sep 30 2013 Michael Mraka <michael.mraka(a)redhat.com> 0.12-1
+- ignore old-style-* pylint warnings for pylint-1.0
+
* Mon Jan 28 2013 Michael Mraka <michael.mraka(a)redhat.com> 0.11-1
- Revert "ignore Container implementation related warnings"
commit e8c173ed53c382fda74cc91ecd9373ffa58ea8db
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Thu Sep 26 11:31:45 2013 +0200
ignore old-style-* pylint warnings for pylint-1.0
diff --git a/spacewalk/pylint/spacewalk-pylint.rc b/spacewalk/pylint/spacewalk-pylint.rc
index 990c8e6..1a04e27 100644
--- a/spacewalk/pylint/spacewalk-pylint.rc
+++ b/spacewalk/pylint/spacewalk-pylint.rc
@@ -12,7 +12,7 @@ persistent=no
[MESSAGES CONTROL]
# Disable the message(s) with the given id(s).
-disable=I0011,C0302,C0111,R0801,R0902,R0904,R0912,R0913,R0914,R0915,W0142,W0403,W0603
+disable=I0011,C0302,C0111,R0801,R0902,R0904,R0912,R0913,R0914,R0915,W0142,W0403,W0603,C1001,W0121
# list of disabled messages:
#I0011: 62: Locally disabling R0201
@@ -27,7 +27,9 @@
disable=I0011,C0302,C0111,R0801,R0902,R0904,R0912,R0913,R0914,R0915,W0142,W0403,
#W0142:228:MPM_Package.write: Used * or ** magic
#W0403: 28: Relative import 'rhnLog', should be 'backend.common.rhnLog'
#W0603: 72:initLOG: Using the global statement
-
+# for pylint-1.0 we also disable
+#C1001: 46, 0: Old-style class defined. (old-style-class)
+#W0121: 33,16: Use raise ErrorClass(args) instead of raise ErrorClass, args.
(old-raise-syntax)
[REPORTS]
diff --git a/spacewalk/pylint/spacewalk-pylint.spec
b/spacewalk/pylint/spacewalk-pylint.spec
index 0ff4ff0..deb898b 100644
--- a/spacewalk/pylint/spacewalk-pylint.spec
+++ b/spacewalk/pylint/spacewalk-pylint.spec
@@ -10,7 +10,11 @@
Source0:
https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
-Requires: pylint
+%if 0%{?fedora} >= 19
+Requires: pylint > 1.0
+%else
+Requires: pylint < 1.0
+%endif
BuildRequires: asciidoc
BuildRequires: libxslt
%if 0%{?rhel} && 0%{?rhel} < 6
@@ -34,6 +38,11 @@ install -d -m 755 %{buildroot}/%{_bindir}
install -p -m 755 spacewalk-pylint %{buildroot}/%{_bindir}/
install -d -m 755 %{buildroot}/%{_sysconfdir}
install -p -m 644 spacewalk-pylint.rc %{buildroot}/%{_sysconfdir}/
+%if 0%{?fedora} < 19
+# old pylint don't understand new checks
+sed -i '/disable=/ s/\(,C1001\|,W0121\)//g;' \
+ %{buildroot}%{_sysconfdir}/spacewalk-pylint.rc
+%endif
mkdir -p %{buildroot}/%{_mandir}/man8
install -m 644 spacewalk-pylint.8 %{buildroot}/%{_mandir}/man8
commit 1c7d5686c4ea937b93f62401d340bc5470125469
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Wed Sep 25 16:09:55 2013 +0200
make pylint 1.0 happy about map/filter on lambda
addressing
W: 72,16: map/filter on lambda could be replaced by comprehension (deprecated-lambda)
...
diff --git a/backend/common/fileutils.py b/backend/common/fileutils.py
index bac640a..f8fc12f 100644
--- a/backend/common/fileutils.py
+++ b/backend/common/fileutils.py
@@ -200,7 +200,7 @@ def rhn_popen(cmd, progressCallback=None, bufferSize=16384,
outputLog=None):
exitcode = status
break
- fd_set = map(lambda x: x[0], fd_mappings)
+ fd_set = [x[0] for x in fd_mappings]
readfds = select.select(fd_set, [], [])[0]
for in_fd, out_fd in fd_mappings:
diff --git a/backend/common/rhnConfig.py b/backend/common/rhnConfig.py
index 00ce47a..cd88072 100644
--- a/backend/common/rhnConfig.py
+++ b/backend/common/rhnConfig.py
@@ -322,7 +322,7 @@ def parse_comps(component):
return [()]
comps = [c.lower() for c in component.split('.')]
# Now generate the prefixes for this component
- return map(lambda i, a=comps: tuple(a[:i]), range(len(comps)+1))
+ return [tuple(comps[:i]) for i in range(len(comps)+1)]
def parse_line(line):
diff --git a/backend/common/rhnTB.py b/backend/common/rhnTB.py
index 660ac7e..209cac3 100644
--- a/backend/common/rhnTB.py
+++ b/backend/common/rhnTB.py
@@ -164,7 +164,7 @@ def Traceback(method = None, req = None, mail = 1, ostream =
sys.stderr,
fr = to
if isinstance(to, type([])):
fr = to[0].strip()
- to = ', '.join(map(lambda x: x.strip(), to))
+ to = ', '.join([x.strip() for x in to])
headers = {
"Subject" : "%s TRACEBACK from %s" % (PRODUCT_NAME,
unicode_hostname),
"From" : "%s <%s>" % (hostname, fr),
diff --git a/backend/common/rhnTranslate.py b/backend/common/rhnTranslate.py
index b5d63b3..01522a9 100644
--- a/backend/common/rhnTranslate.py
+++ b/backend/common/rhnTranslate.py
@@ -69,7 +69,7 @@ class i18n:
if isinstance(langs, types.StringType):
langs = [ langs ]
# Filter "C" - we will add it ourselves later anyway
- langs = filter(lambda x: x != 'C', langs)
+ langs = [l for l in langs if l != 'C']
langs.extend(self._default_langs)
self.langs = langs
self._set_catalog()
diff --git a/backend/common/rhn_rpm.py b/backend/common/rhn_rpm.py
index bfa9d82..3e8ac90 100644
--- a/backend/common/rhn_rpm.py
+++ b/backend/common/rhn_rpm.py
@@ -409,13 +409,13 @@ def sortRPMs(rpms):
assert isinstance(rpms, type([]))
# Build a list of (header, rpm)
- helper = map(lambda x: (get_package_header(x), x), rpms)
+ helper = [(get_package_header(x), x) for x in rpms]
# Sort the list using the headers as a comparison
helper.sort(lambda x, y: hdrLabelCompare(x[0], y[0]))
# Extract the rpm names now
- return map(lambda x: x[1], helper)
+ return [x[1] for x in helper]
def getInstalledHeader(rpmName):