summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-01-28 14:55:20 +0100
committerMartin Kosek <mkosek@redhat.com>2013-01-29 15:39:49 +0100
commit77bb4b517769f7707514b0f7e3da5762ff0f1cc4 (patch)
tree36009d639a72d746c653b79d9562cd738cf3ac43 /ipapython
parent41d11f443bebc0a1303980363a4f751bfdbf2c12 (diff)
downloadfreeipa-77bb4b517769f7707514b0f7e3da5762ff0f1cc4.tar.gz
freeipa-77bb4b517769f7707514b0f7e3da5762ff0f1cc4.tar.xz
freeipa-77bb4b517769f7707514b0f7e3da5762ff0f1cc4.zip
Pylint cleanup.
Add more dynamic attribute info to IPATypeChecker in make-lint. Remove unnecessary pylint comments. Fix false positivies introduced by Pylint 0.26. https://fedorahosted.org/freeipa/ticket/3379
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/cookie.py18
-rw-r--r--ipapython/ipautil.py2
-rw-r--r--ipapython/nsslib.py17
3 files changed, 16 insertions, 21 deletions
diff --git a/ipapython/cookie.py b/ipapython/cookie.py
index bf551b518..aed312a3a 100644
--- a/ipapython/cookie.py
+++ b/ipapython/cookie.py
@@ -64,12 +64,6 @@ escaping and unescapin.
#-------------------------------------------------------------------------------
-# FIXME: The use of properties for the attributes timestamp, expires
-# and max_age produce a pylint error which is a false positive, this
-# is a known bug in pylint (http://www.logilab.org/ticket/89092,
-# http://www.logilab.org/ticket/89786) after the pylint bug is fixed
-# the disables for E0202 should be removed.
-
class Cookie(object):
'''
A Cookie object has the following attributes:
@@ -366,7 +360,7 @@ class Cookie(object):
self.timestamp = timestamp
@property
- def timestamp(self): #pylint: disable=E0202
+ def timestamp(self):
'''
The UTC moment at which cookie was received for purposes of
computing the expiration given a Max-Age offset. The
@@ -389,7 +383,7 @@ class Cookie(object):
return self._timestamp
@timestamp.setter
- def timestamp(self, value): #pylint: disable=E0202
+ def timestamp(self, value):
if value is None:
self._timestamp = None
elif isinstance(value, datetime.datetime):
@@ -403,7 +397,7 @@ class Cookie(object):
value.__class__.__name__)
@property
- def expires(self): #pylint: disable=E0202
+ def expires(self):
'''
The expiration timestamp (in UTC) as a datetime object for the
cookie, or None if not set.
@@ -415,7 +409,7 @@ class Cookie(object):
return self._expires
@expires.setter
- def expires(self, value): #pylint: disable=E0202
+ def expires(self, value):
if value is None:
self._expires = None
elif isinstance(value, datetime.datetime):
@@ -429,7 +423,7 @@ class Cookie(object):
value.__class__.__name__)
@property
- def max_age(self): #pylint: disable=E0202
+ def max_age(self):
'''
The lifetime duration of the cookie. Computed as an offset
from the cookie's timestamp.
@@ -437,7 +431,7 @@ class Cookie(object):
return self._max_age
@max_age.setter
- def max_age(self, value): #pylint: disable=E0202
+ def max_age(self, value):
if value is None:
self._max_age = None
else:
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 9fdd2fd76..c0ac3a1f7 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -775,7 +775,7 @@ def bind_port_responder(port, socket_type=socket.SOCK_STREAM, socket_timeout=Non
connection, client_address = s.accept()
try:
if responder_data:
- connection.sendall(responder_data) #pylint: disable=E1101
+ connection.sendall(responder_data)
finally:
connection.close()
elif socket_type == socket.SOCK_DGRAM:
diff --git a/ipapython/nsslib.py b/ipapython/nsslib.py
index 7afccd568..fd74dcb74 100644
--- a/ipapython/nsslib.py
+++ b/ipapython/nsslib.py
@@ -200,14 +200,15 @@ class NSSConnection(httplib.HTTPConnection, NSSAddressFamilyFallback):
def _create_socket(self):
# TODO: remove the try block once python-nss is guaranteed to contain
# these values
- try :
- ssl_enable_renegotiation = SSL_ENABLE_RENEGOTIATION #pylint: disable=E0602
- ssl_require_safe_negotiation = SSL_REQUIRE_SAFE_NEGOTIATION #pylint: disable=E0602
- ssl_renegotiate_requires_xtn = SSL_RENEGOTIATE_REQUIRES_XTN #pylint: disable=E0602
- except :
- ssl_enable_renegotiation = 20
- ssl_require_safe_negotiation = 21
- ssl_renegotiate_requires_xtn = 2
+ try:
+ #pylint: disable=E1101
+ ssl_enable_renegotiation = ssl.SSL_ENABLE_RENEGOTIATION
+ ssl_require_safe_negotiation = ssl.SSL_REQUIRE_SAFE_NEGOTIATION
+ ssl_renegotiate_requires_xtn = ssl.SSL_RENEGOTIATE_REQUIRES_XTN
+ except:
+ ssl_enable_renegotiation = 20
+ ssl_require_safe_negotiation = 21
+ ssl_renegotiate_requires_xtn = 2
# Create the socket here so we can do things like let the caller
# override the NSS callbacks