Merge pull request #43606 from adk3798/suppress-tls-error

mgr/cephadm: suppress TLSV1_ALERT_DECRYPT_ERROR from cherrypy

Reviewed-by: Sebastian Wagner <sewagner@redhat.com>
This commit is contained in:
Sebastian Wagner 2021-10-30 20:46:48 +02:00 committed by GitHub
commit e9636ddd24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
import cherrypy
import ipaddress
import json
import logging
import socket
import ssl
import tempfile
@ -27,6 +28,18 @@ if TYPE_CHECKING:
from cephadm.module import CephadmOrchestrator
def cherrypy_filter(record: logging.LogRecord) -> int:
blocked = [
'TLSV1_ALERT_DECRYPT_ERROR'
]
msg = record.getMessage()
return not any([m for m in blocked if m in msg])
logging.getLogger('cherrypy.access').addFilter(cherrypy_filter)
logging.getLogger('cherrypy.error').addFilter(cherrypy_filter)
class CherryPyThread(threading.Thread):
def __init__(self, mgr: "CephadmOrchestrator") -> None:
self.mgr = mgr