Commit 90ca73fd authored by Jérome Perrin's avatar Jérome Perrin

fix pylint warnings

note that:
 - _version is a generated/vendored file, so we just disable all
 - ssl.OP_NO_TLSv1 and OP_NO_TLSv1_1 are not detected by pylint, so we add
   a local ignore
parent 7f6bdd71
Pipeline #25907 running with stage
in 0 seconds
# pylint: disable-all
# This file helps to compute a version number in source trees obtained from # This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag # git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build # feature). Distribution tarballs (built by setup.py sdist) and build
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
# See https://www.nexedi.com/licensing for rationale and options. # See https://www.nexedi.com/licensing for rationale and options.
from cryptography import x509 from cryptography import x509
from cryptography.hazmat.primitives.serialization import Encoding
from threading import local from threading import local
from wsgiref.simple_server import make_server from wsgiref.simple_server import make_server
import caucase.exceptions import caucase.exceptions
...@@ -170,7 +169,7 @@ class SQLite3Storage(local): ...@@ -170,7 +169,7 @@ class SQLite3Storage(local):
return bool(result) return bool(result)
def reserveId(self): def reserveId(self):
for trynum in range(10): for _ in range(10):
reserved_id = ''.join( reserved_id = ''.join(
random.choice( random.choice(
string.ascii_lowercase + string.digits) for _ in range(32)) string.ascii_lowercase + string.digits) for _ in range(32))
...@@ -490,7 +489,7 @@ def getSSLContext(server_key_path, ca_certificate_path, crl_path): ...@@ -490,7 +489,7 @@ def getSSLContext(server_key_path, ca_certificate_path, crl_path):
# ssl_context.verify_flags = ssl.VERIFY_CRL_CHECK_LEAF # ssl_context.verify_flags = ssl.VERIFY_CRL_CHECK_LEAF
# ssl_context.load_verify_locations(cafile=crl_path) # ssl_context.load_verify_locations(cafile=crl_path)
ssl_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 ssl_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 # pylint:disable=no-member
ssl_context.verify_mode = ssl.CERT_OPTIONAL ssl_context.verify_mode = ssl.CERT_OPTIONAL
ssl_context.load_verify_locations(cafile=ca_certificate_path) ssl_context.load_verify_locations(cafile=ca_certificate_path)
ssl_context.load_cert_chain(server_key_path) ssl_context.load_cert_chain(server_key_path)
......
...@@ -31,7 +31,6 @@ import requests ...@@ -31,7 +31,6 @@ import requests
import requests.exceptions import requests.exceptions
import shutil import shutil
import signal import signal
import sys
import tarfile import tarfile
import tempfile import tempfile
import time import time
...@@ -328,9 +327,9 @@ ez+ONyvetfvjD8cxyQ== ...@@ -328,9 +327,9 @@ ez+ONyvetfvjD8cxyQ==
self.kedifa_runtime.start() self.kedifa_runtime.start()
self.assertTrue(self.kedifa_runtime.is_alive()) self.assertTrue(self.kedifa_runtime.is_alive())
# give 5s for KeDiFa to be available # give KeDiFa some time to be available
b = time.time() b = time.time()
for i in range(100): for _ in range(100):
try: try:
self.requests_get(self.kedifa_url + 'ping') self.requests_get(self.kedifa_url + 'ping')
except BaseException: except BaseException:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment