Skip to content

Commit a05908a

Browse files
authored
Fix ElasticSearch UnsupportedProductError (#994)
* Fix ES UnsupportedProductError * Coderabbit review
1 parent b25434c commit a05908a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

cloud_governance/common/elasticsearch/elasticsearch_operations.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ def __init__(self,
5757
except Exception as err:
5858
self.__es = None
5959

60+
# Skip product check for OpenSearch compatibility (elasticsearch-py 7.14+ rejects non-Elasticsearch servers)
61+
try:
62+
if self.__es and hasattr(self.__es.transport, '_verified_elasticsearch'):
63+
self.__es.transport._verified_elasticsearch = True
64+
except AttributeError as err:
65+
logger.warning(f"Could not bypass Elasticsearch product check: {err}")
66+
6067
def __elasticsearch_get_index_hits(self, index: str, uuid: str = '', workload: str = '', fast_check: bool = False,
6168
id: bool = False):
6269
"""

0 commit comments

Comments
 (0)