diff --git a/fmatch/matcher.py b/fmatch/matcher.py index 543ba40..5f2715e 100644 --- a/fmatch/matcher.py +++ b/fmatch/matcher.py @@ -19,7 +19,10 @@ class Matcher: """Matcher""" def __init__( - self, index="perf_scale_ci", level=logging.INFO, ES_URL=os.getenv("ES_SERVER") + self, index="ospst-perf-scale-ci", + level=logging.INFO, + ES_URL=os.getenv("ES_SERVER"), + verify_certs=True ): self.index = index self.es_url = ES_URL @@ -35,7 +38,7 @@ def __init__( self.logger.addHandler(handler) # We can set the ES logging higher if we want additional debugging logging.getLogger("elasticsearch").setLevel(logging.WARN) - self.es = Elasticsearch([self.es_url], timeout=30) + self.es = Elasticsearch([self.es_url], timeout=30, verify_certs=verify_certs) self.data = None def get_metadata_by_uuid(self, uuid, index=None): @@ -96,14 +99,13 @@ def get_uuid_by_metadata(self, meta, index=None): "buildUrl":hit.to_dict()["_source"]["buildUrl"]} for hit in hits] return uuids_docs - def match_kube_burner(self, uuids): + def match_kube_burner(self, uuids, index): """match kube burner runs Args: uuids (list): list of uuids Returns: list : list of runs """ - index = "ripsaw-kube-burner*" query = Q( "bool", filter=[ diff --git a/fmatch/tests/test_matcher.py b/fmatch/tests/test_matcher.py index 6b7d51b..44a527a 100644 --- a/fmatch/tests/test_matcher.py +++ b/fmatch/tests/test_matcher.py @@ -78,7 +78,7 @@ def test_get_uuid_by_metadata(matcher_instance): def test_match_kube_burner(matcher_instance): - result = matcher_instance.match_kube_burner(["uuid1"]) + result = matcher_instance.match_kube_burner(["uuid1"],index="ospst-*") expected = [ {"uuid": "uuid1", "field1": "value1"}, {"uuid": "uuid2", "field1": "value2"}, diff --git a/setup.py b/setup.py index f1732ce..6e44201 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages -VERSION = '0.0.6' +VERSION = '0.0.7' DESCRIPTION = 'Common package for matching runs with provided metadata' # pylint: disable= line-too-long LONG_DESCRIPTION = "A package that allows to match metadata and get runs and create csv files with queried metrics"