From 05b091236d661e320cf1855e9429f4d59a0fb20c Mon Sep 17 00:00:00 2001 From: beaioun Date: Wed, 8 Nov 2023 10:15:33 -0800 Subject: [PATCH 1/3] Switching from RequestsHttpConnection to the default Urllib3HttpConnection Signed-off-by: beaioun --- osbenchmark/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osbenchmark/client.py b/osbenchmark/client.py index f779a5999..746428e3a 100644 --- a/osbenchmark/client.py +++ b/osbenchmark/client.py @@ -294,7 +294,7 @@ def create(self): aws_auth = opensearchpy.AWSV4SignerAuth(credentials, self.aws_log_in_dict["region"], self.aws_log_in_dict["service"]) return opensearchpy.OpenSearch(hosts=self.hosts, use_ssl=True, verify_certs=True, http_auth=aws_auth, - connection_class=opensearchpy.RequestsHttpConnection) + connection_class=opensearchpy.Urllib3HttpConnection) def create_async(self): # pylint: disable=import-outside-toplevel From 94df5ca70023ae0dff3a43ca1372c0f8b1a890d6 Mon Sep 17 00:00:00 2001 From: Mingyang Shi Date: Fri, 17 Nov 2023 01:18:15 -0800 Subject: [PATCH 2/3] This commit should be able to fix it as Urllib3AWSV4SingerAuth is callable and will be passed directly to the header without having the former issue. Signed-off-by: Mingyang Shi --- osbenchmark/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osbenchmark/client.py b/osbenchmark/client.py index 746428e3a..7a93944cb 100644 --- a/osbenchmark/client.py +++ b/osbenchmark/client.py @@ -291,7 +291,7 @@ def create(self): credentials = Credentials(access_key=self.aws_log_in_dict["aws_access_key_id"], secret_key=self.aws_log_in_dict["aws_secret_access_key"], token=self.aws_log_in_dict["aws_session_token"]) - aws_auth = opensearchpy.AWSV4SignerAuth(credentials, self.aws_log_in_dict["region"], + aws_auth = opensearchpy.Urllib3AWSV4SignerAuth(credentials, self.aws_log_in_dict["region"], self.aws_log_in_dict["service"]) return opensearchpy.OpenSearch(hosts=self.hosts, use_ssl=True, verify_certs=True, http_auth=aws_auth, connection_class=opensearchpy.Urllib3HttpConnection) From 769ff90bc024efbe725b4d11c14b0781a137d63c Mon Sep 17 00:00:00 2001 From: beaioun Date: Fri, 17 Nov 2023 16:52:43 -0800 Subject: [PATCH 3/3] Switching to os-py 2.4.1 and fixing the removed _normalize_hosts import in os-py client in this version. Signed-off-by: beaioun --- osbenchmark/utils/opts.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/osbenchmark/utils/opts.py b/osbenchmark/utils/opts.py index 866cfec92..e30c067f7 100644 --- a/osbenchmark/utils/opts.py +++ b/osbenchmark/utils/opts.py @@ -179,7 +179,7 @@ def normalize_to_dict(arg): defined as a json string or file. """ # pylint: disable=import-outside-toplevel - from opensearchpy.client import _normalize_hosts + from opensearchpy.client.utils import _normalize_hosts return {TargetHosts.DEFAULT: _normalize_hosts(arg)} self.parsed_options = to_dict(self.argvalue, default_parser=normalize_to_dict) diff --git a/setup.py b/setup.py index f93e9d000..c422dc0ce 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ def str_from_file(name): # transitive dependencies: # urllib3: MIT # aiohttp: Apache 2.0 - "opensearch-py[async]==2.3.2", + "opensearch-py[async]==2.4.1", # License: BSD "psutil==5.8.0", # License: MIT