Skip to content

Commit

Permalink
Updated Handlers.py for elasticsearch 8.0
Browse files Browse the repository at this point in the history
changed from RequestsHttpConnection to RequestsHttpNode as 'RequestsHttpConnection' was removed from 'elasticsearch' and is replaced with RequestsHttpNode from elastic_transport elastic/elasticsearch-py#1778 (comment)
  • Loading branch information
Tommy Burke authored and Tommy Burke committed Apr 27, 2022
1 parent a7993c1 commit 25b418d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions elasticecslogging/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import uuid
from threading import Timer, Lock

from elasticsearch import Elasticsearch, RequestsHttpConnection
from elasticsearch import Elasticsearch
from elastic_transport import RequestsHttpNode
from elasticsearch import helpers as eshelpers
from enum import Enum

Expand Down Expand Up @@ -261,7 +262,7 @@ def __get_es_client(self):
self._client = Elasticsearch(hosts=self.hosts,
use_ssl=self.use_ssl,
verify_certs=self.verify_certs,
connection_class=RequestsHttpConnection,
connection_class=RequestsHttpNode,
serializer=self.serializer)
return self._client

Expand All @@ -271,7 +272,7 @@ def __get_es_client(self):
http_auth=self.auth_details,
use_ssl=self.use_ssl,
verify_certs=self.verify_certs,
connection_class=RequestsHttpConnection,
connection_class=RequestsHttpNode,
serializer=self.serializer)
return self._client

Expand All @@ -282,7 +283,7 @@ def __get_es_client(self):
return Elasticsearch(hosts=self.hosts,
use_ssl=self.use_ssl,
verify_certs=self.verify_certs,
connection_class=RequestsHttpConnection,
connection_class=RequestsHttpNode,
http_auth=HTTPKerberosAuth(mutual_authentication=DISABLED),
serializer=self.serializer)

Expand All @@ -296,7 +297,7 @@ def __get_es_client(self):
http_auth=awsauth,
use_ssl=self.use_ssl,
verify_certs=True,
connection_class=RequestsHttpConnection,
connection_class=RequestsHttpNode,
serializer=self.serializer
)
return self._client
Expand Down

0 comments on commit 25b418d

Please sign in to comment.