79 lines
3.1 KiB
Diff
79 lines
3.1 KiB
Diff
From a0ffcd6f8ba610c20808a2f863d384b7631c64ac Mon Sep 17 00:00:00 2001
|
|
From: David Kupka <dkupka@redhat.com>
|
|
Date: Fri, 27 Mar 2015 07:14:27 -0400
|
|
Subject: [PATCH] Make lint work on Fedora 22.
|
|
|
|
pylint added 'confidence' parameter to 'add_message' method of PyLinter.
|
|
To be compatible with both, pre- and post- 1.4 IPALinter must accept
|
|
the parameter but not pass it over.
|
|
Also python3 checker was added and enabled by default. FreeIPA is still
|
|
not ready for python3.
|
|
Additionally few false-positives was marked.
|
|
---
|
|
ipalib/plugins/otptoken.py | 1 +
|
|
ipapython/dnssec/ldapkeydb.py | 1 +
|
|
ipaserver/install/ipa_otptoken_import.py | 1 +
|
|
make-lint | 3 ++-
|
|
4 files changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/ipalib/plugins/otptoken.py b/ipalib/plugins/otptoken.py
|
|
index b87145df80a3be9b16d596dd4072129c2290f40a..867659ec2a867b2dba79922a4e98b7b6254e81bf 100644
|
|
--- a/ipalib/plugins/otptoken.py
|
|
+++ b/ipalib/plugins/otptoken.py
|
|
@@ -547,6 +547,7 @@ class otptoken_sync(Local):
|
|
query = urllib.urlencode(query)
|
|
|
|
# Sync the token.
|
|
+ # pylint: disable=E1101
|
|
handler = HTTPSHandler(ca_certs=os.path.join(self.api.env.confdir, 'ca.crt'),
|
|
cert_reqs=ssl.CERT_REQUIRED,
|
|
ssl_version=ssl.PROTOCOL_TLSv1)
|
|
diff --git a/ipapython/dnssec/ldapkeydb.py b/ipapython/dnssec/ldapkeydb.py
|
|
index 71c0a95a39b1b460178d0b853ed26bf2cfe5bda1..520b510707d432d2e432c55ca25f2a872d832348 100644
|
|
--- a/ipapython/dnssec/ldapkeydb.py
|
|
+++ b/ipapython/dnssec/ldapkeydb.py
|
|
@@ -23,6 +23,7 @@ def uri_escape(val):
|
|
assert len(val) > 0, "zero-length URI component detected"
|
|
hexval = hexlify(val)
|
|
out = '%'
|
|
+ # pylint: disable=E1127
|
|
out += '%'.join(hexval[i:i+2] for i in range(0, len(hexval), 2))
|
|
return out
|
|
|
|
diff --git a/ipaserver/install/ipa_otptoken_import.py b/ipaserver/install/ipa_otptoken_import.py
|
|
index b78aba93a2edc987450d921c87ea4f61b014b419..c6a69c9975cc113c10d0dee669f9db619422a9d3 100644
|
|
--- a/ipaserver/install/ipa_otptoken_import.py
|
|
+++ b/ipaserver/install/ipa_otptoken_import.py
|
|
@@ -60,6 +60,7 @@ def convertDate(value):
|
|
|
|
dt = dateutil.parser.parse(value)
|
|
|
|
+ # pylint: disable=E1101
|
|
if dt.tzinfo is None:
|
|
dt = datetime.datetime(*dt.timetuple()[0:6],
|
|
tzinfo=dateutil.tz.tzlocal())
|
|
diff --git a/make-lint b/make-lint
|
|
index bd0eb4d75c50c794dbd40444ab035df5a5153d6c..8016d1c3554944d7799aefe0242f4f844e76e32c 100755
|
|
--- a/make-lint
|
|
+++ b/make-lint
|
|
@@ -143,7 +143,7 @@ class IPALinter(PyLinter):
|
|
return
|
|
super(IPALinter, self).register_checker(checker)
|
|
|
|
- def add_message(self, msg_id, line=None, node=None, args=None):
|
|
+ def add_message(self, msg_id, line=None, node=None, args=None, confidence=None):
|
|
if line is None and node is not None:
|
|
line = node.fromlineno
|
|
|
|
@@ -235,6 +235,7 @@ def main():
|
|
'{path}:{line}: [{msg_id}({symbol}), {obj}] {msg})')
|
|
linter.set_option('reports', False)
|
|
linter.set_option('persistent', False)
|
|
+ linter.set_option('disable', 'python3')
|
|
|
|
linter.check(files)
|
|
|
|
--
|
|
2.1.0
|
|
|