From 856a55aa5f5d77fb25a0be4ee0aaecc481db3d52 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Thu, 14 Apr 2022 21:56:37 +0800 Subject: [PATCH] fixed es auth issue --- python/crawlab/config/__init__.py | 2 +- python/crawlab/db/es.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/crawlab/config/__init__.py b/python/crawlab/config/__init__.py index 46df43f..c3e0bec 100644 --- a/python/crawlab/config/__init__.py +++ b/python/crawlab/config/__init__.py @@ -1 +1 @@ -VERSION = '0.3.4' +VERSION = '0.3.5' diff --git a/python/crawlab/db/es.py b/python/crawlab/db/es.py index b34f6bf..8774da3 100644 --- a/python/crawlab/db/es.py +++ b/python/crawlab/db/es.py @@ -9,7 +9,7 @@ def get_client() -> elasticsearch.Elasticsearch: ds = get_data_source() base_auth = None if ds.get('username') is not None and ds.get('password') is not None: - base_auth = f'{ds.get("username")}:{ds.get("password")}' + base_auth = (ds.get('username'), ds.get('password')) return elasticsearch.Elasticsearch( hosts=[{'host': ds.get('host'), 'port': ds.get('port')}], basic_auth=base_auth,