Merge "make metadata indexing optional"

This commit is contained in:
Zuul 2024-11-20 09:44:32 +00:00 committed by Gerrit Code Review
commit 64ba133a57
3 changed files with 16 additions and 18 deletions

View File

@ -73,9 +73,7 @@ class Elastic(object):
return json_data return json_data
def combine_metadata(self, result): def combine_metadata(self, result):
if (self.config['elasticsearch']['metadata_files'] is not None and meta = self.config['elasticsearch'].get('metadata_files', []) or []
len(self.config['elasticsearch']['metadata_files']) > 0):
meta = self.config['elasticsearch']['metadata_files']
for _meta in meta: for _meta in meta:
try: try:
with open(_meta['file']) as jdata: with open(_meta['file']) as jdata:

View File

@ -62,7 +62,7 @@ mapping:
required: True required: True
metadata_files: metadata_files:
type: seq type: seq
required: True required: False
sequence: sequence:
- type: map - type: map
mapping: mapping:

View File

@ -70,7 +70,7 @@ class Tools(object):
workloads.run_workload(copy.deepcopy(workload), run_iteration) workloads.run_workload(copy.deepcopy(workload), run_iteration)
def check_metadata(self): def check_metadata(self):
meta = self.config['elasticsearch']['metadata_files'] meta = self.config['elasticsearch'].get('metadata_files', []) or []
for _meta in meta: for _meta in meta:
if not os.path.isfile(_meta['file']): if not os.path.isfile(_meta['file']):
self.logger.info( self.logger.info(