5.0 compatibility

This commit is contained in:
Honza Král
2016-03-22 21:04:07 +01:00
parent b10ae7c891
commit 6e94bf76ad
14 changed files with 187 additions and 155 deletions
@@ -7,6 +7,7 @@ import re
from os import walk, environ
from os.path import exists, join, dirname, pardir
import yaml
from shutil import rmtree
from elasticsearch import TransportError
from elasticsearch.compat import string_types
@@ -48,6 +49,13 @@ class YamlTestCase(ElasticsearchTestCase):
self.last_response = None
self._state = {}
def tearDown(self):
super(YamlTestCase, self).tearDown()
for repo, definition in self.client.snapshot.get_repository(repository='_all').items():
self.client.snapshot.delete_repository(repository=repo)
if definition['type'] == 'fs':
rmtree('/tmp/%s' % definition['settings']['location'])
def _resolve(self, value):
# resolve variables
if isinstance(value, string_types) and value.startswith('$'):