From 6e6ad04c5cc55a76984141f13eb65c5aec9f34d4 Mon Sep 17 00:00:00 2001 From: Seth Michael Larson Date: Tue, 14 Jul 2020 09:51:35 -0500 Subject: [PATCH] Use 'script.context.field.max_compilations_rate' instead of deprecated setting --- eland/tests/setup_tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/eland/tests/setup_tests.py b/eland/tests/setup_tests.py index 222f92c..b858c64 100644 --- a/eland/tests/setup_tests.py +++ b/eland/tests/setup_tests.py @@ -35,6 +35,7 @@ from eland.tests import ( ES_TEST_CLIENT, ELASTICSEARCH_HOST, ) +from eland.common import es_version DATA_LIST = [ @@ -87,7 +88,10 @@ def _setup_data(es): def _update_max_compilations_limit(es, limit="10000/1m"): print("Updating script.max_compilations_rate to ", limit) - body = {"transient": {"script.max_compilations_rate": limit}} + if es_version(es) < (7, 8): + body = {"transient": {"script.max_compilations_rate": limit}} + else: + body = {"transient": {"script.context.field.max_compilations_rate": limit}} es.cluster.put_settings(body=body)