diff --git a/api/base/settings/defaults.py b/api/base/settings/defaults.py index d74e744f787..a7d8838fe04 100644 --- a/api/base/settings/defaults.py +++ b/api/base/settings/defaults.py @@ -317,7 +317,7 @@ # django-elasticsearch-metrics ELASTICSEARCH_DSL = { 'default': { - 'hosts': os.environ.get('ELASTIC6_URI', '127.0.0.1:9201'), + 'hosts': osf_settings.ELASTIC6_URI, 'retry_on_timeout': True, }, } diff --git a/conftest.py b/conftest.py index 1acfabbdbb5..2eb51df076e 100644 --- a/conftest.py +++ b/conftest.py @@ -124,7 +124,7 @@ def _test_speedups_disable(request, settings, _test_speedups): @pytest.fixture(scope='session') def setup_connections(): - connections.create_connection(hosts=['http://localhost:9201']) + connections.create_connection(hosts=[website_settings.ELASTIC6_URI]) @pytest.fixture(scope='function') diff --git a/website/settings/defaults.py b/website/settings/defaults.py index 7d6df427336..85c66a9dad9 100644 --- a/website/settings/defaults.py +++ b/website/settings/defaults.py @@ -114,6 +114,7 @@ def parent_dir(path): # 'client_cert': None, # 'client_key': None } +ELASTIC6_URI = os.environ.get('ELASTIC6_URI', '127.0.0.1:9201') # Sessions COOKIE_NAME = 'osf'