Commit 67fdc908 authored by Aurel's avatar Aurel

remove useless code

parent 7ccb530a
......@@ -77,9 +77,6 @@ class KedifaMixin(object):
class KedifaMixinCaucase(KedifaMixin):
def createKey(self):
"""Generates a key and return a tuple containing the RSAPrivateKey
and the PEM encoded version as a string.
"""
key = rsa.generate_private_key(
public_exponent=65537, key_size=2048, backend=default_backend())
key_pem = key.private_bytes(
......@@ -137,7 +134,7 @@ class KedifaMixinCaucase(KedifaMixin):
not_valid_after
).sign(key, hashes.SHA256(), default_backend())
certificate_pem = certificate.public_bytes(serialization.Encoding.PEM)
return key, key_pem, certificate, certificate_pem#.decode('ascii')
return key, key_pem, certificate, certificate_pem
def createPem(self):
_, key_pem, _, certificate_pem = self.generateKeyCertificateData()
......@@ -322,34 +319,6 @@ class KedifaIntegrationTest(KedifaMixinCaucase, unittest.TestCase):
with open(self.logfile) as fh:
last_log_line = fh.readlines()[-1]
if sys.version_info[:2] == (3, 5): # BBB python 3.5 compatibility
# On python3.5, errors like this are logged on SSL client errors:
#
# $timestamp - kedifa - ERROR - Exception while handling the request
# Traceback (most recent call last):
# File "/usr/lib/python3.5/wsgiref/handlers.py", line 138, in run
# self.finish_response()
# File "/usr/lib/python3.5/wsgiref/handlers.py", line 180, in finish_response
# self.write(data)
# File "/usr/lib/python3.5/wsgiref/handlers.py", line 279, in write
# self._write(data)
# File "/usr/lib/python3.5/wsgiref/handlers.py", line 453, in _write
# result = self.stdout.write(data)
# File "/usr/lib/python3.5/socket.py", line 594, in write
# return self._sock.send(b)
# File "/usr/lib/python3.5/ssl.py", line 869, in send
# return self._sslobj.write(data)
# File "/usr/lib/python3.5/ssl.py", line 594, in write
# return self._sslobj.write(data)
# ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:1949)
with open(self.logfile) as fh:
line_list = fh.readlines()
before_last_log_line = line_list[-2] if len(line_list) > 2 else ''
if "ssl.SSLEOFError: EOF occurred in violation of protocol" in before_last_log_line:
# and the actual "last" log line is before this traceback.
# BBB drop: all this when we stop supporting 3.5
last_log_line =line_list[-19]
self.assertTrue(
entry in last_log_line, '%r not found in %r' % (entry, last_log_line))
......
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