Skip to content

Commit ddbf918

Browse files
fstagniweb-flow
authored andcommitted
sweep: #7981 fix: removed elastic in favor of opensearch client
1 parent 379b7d1 commit ddbf918

File tree

3 files changed

+14
-34
lines changed

3 files changed

+14
-34
lines changed

environment.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ dependencies:
1717
- cmreshandler >1.0.0b4
1818
- cwltool
1919
- db12
20-
- elasticsearch <7.14
21-
- elasticsearch-dsl
2220
- opensearch-py
2321
- fts3
2422
- gitpython >=2.1.0

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ server =
7171
# (it just installs into site-packages)
7272
# arc
7373
CMRESHandler
74-
elasticsearch <7.14
75-
elasticsearch_dsl
74+
opensearch-py
7675
GitPython
7776
ldap3
7877
apache-libcloud

src/DIRAC/Core/Utilities/ElasticSearchDB.py

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,22 @@
1111
from urllib import parse as urlparse
1212

1313
import certifi
14+
from opensearchpy import OpenSearch as Elasticsearch
15+
from opensearchpy.exceptions import (
16+
ConflictError,
17+
NotFoundError,
18+
RequestError,
19+
TransportError,
20+
)
21+
from opensearchpy.exceptions import (
22+
ConnectionError as ElasticConnectionError,
23+
)
24+
from opensearchpy.helpers import BulkIndexError, bulk
1425

1526
try:
16-
from opensearchpy import OpenSearch as Elasticsearch
17-
from opensearchpy.exceptions import (
18-
ConflictError,
19-
NotFoundError,
20-
RequestError,
21-
TransportError,
22-
)
23-
from opensearchpy.exceptions import (
24-
ConnectionError as ElasticConnectionError,
25-
)
26-
from opensearchpy.helpers import BulkIndexError, bulk
27+
from opensearchpy import A, Q, Search
2728
except ImportError:
28-
from elasticsearch import Elasticsearch
29-
from elasticsearch.exceptions import (
30-
ConflictError,
31-
NotFoundError,
32-
RequestError,
33-
TransportError,
34-
)
35-
from elasticsearch.exceptions import (
36-
ConnectionError as ElasticConnectionError,
37-
)
38-
from elasticsearch.helpers import BulkIndexError, bulk
39-
40-
try:
41-
try:
42-
from opensearchpy import A, Q, Search
43-
except ImportError:
44-
from opensearch_dsl import A, Q, Search
45-
except ImportError:
46-
from elasticsearch_dsl import A, Q, Search
29+
from opensearch_dsl import A, Q, Search
4730

4831

4932
from DIRAC import S_ERROR, S_OK, gLogger

0 commit comments

Comments
 (0)