[7.x] Restore default metric='_all' to cluster.state()

This commit is contained in:
Seth Michael Larson
2020-03-10 12:08:03 -05:00
committed by GitHub
parent 210fae23d0
commit 8074ff294b
5 changed files with 50 additions and 1 deletions
+8 -1
View File
@@ -1,3 +1,4 @@
from unittest import SkipTest
from elasticsearch.helpers import test
from elasticsearch.helpers.test import ElasticsearchTestCase as BaseTestCase
@@ -6,6 +7,8 @@ client = None
def get_client(**kwargs):
global client
if client is False:
raise SkipTest("No client is available")
if client is not None and not kwargs:
return client
@@ -16,7 +19,11 @@ def get_client(**kwargs):
new_client = local_get_client(**kwargs)
except ImportError:
# fallback to using vanilla client
new_client = test.get_test_client(**kwargs)
try:
new_client = test.get_test_client(**kwargs)
except SkipTest:
client = False
raise
if not kwargs:
client = new_client