From baa68efca4836c6e80c16524cd9ee29e60770acd Mon Sep 17 00:00:00 2001 From: Artem Kondratyev Date: Mon, 11 Nov 2019 18:52:23 +0300 Subject: [PATCH] Fix AttributeError for Elasticsearch>2.0.0,<3.0.0 AIOHttpConnection takes use_ssl argument and passes one to the parent's __init__. Then self.use_ssl gets used instead of use_ssl here https://github.com/aio-libs/aioelasticsearch/blob/master/aioelasticsearch/connection.py#L52 It works for the latest elasticsearch-py versions, however, it doesn't work with >2.0.0, b/c there's no self.use_ssl = use_ssl there. --- aioelasticsearch/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aioelasticsearch/connection.py b/aioelasticsearch/connection.py index 4903d517..1c532a22 100644 --- a/aioelasticsearch/connection.py +++ b/aioelasticsearch/connection.py @@ -49,7 +49,7 @@ def __init__( self.verify_certs = verify_certs - self.base_url = URL.build(scheme='https' if self.use_ssl else 'http', + self.base_url = URL.build(scheme='https' if use_ssl else 'http', host=host, port=port, path=self.url_prefix)