Skip to content

Commit

Permalink
Upload Comparison result using multiple decision type
Browse files Browse the repository at this point in the history
Signed-off-by: Riya <[email protected]>
  • Loading branch information
riya-17 committed Oct 19, 2023
1 parent 63f9499 commit acc05c7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
9 changes: 9 additions & 0 deletions opl/investigator/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,12 @@ def load_config(conf, fp):
conf.decisions_es_index = data["decisions"]["es_index"]
if conf.decisions_type == "csv":
conf.decisions_filename = data["decisions"]["filename"]

decision_type = conf.decisions_type.split(',')
for d_type in decision_type:
if d_type.strip() == "elasticsearch":
conf.decisions_es_server = data["decisions"]["es_server"]
assert not conf.decisions_es_server.endswith("/")
conf.decisions_es_index = data["decisions"]["es_index"]
if d_type.strip() == "csv":
conf.decisions_filename = data["decisions"]["filename"]
14 changes: 8 additions & 6 deletions opl/pass_or_fail.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,14 @@ def main():
get_stats(info_all, "method")

if not args.dry_run:
if args.decisions_type == "elasticsearch":
opl.investigator.elasticsearch_decisions.store(
args.decisions_es_server, args.decisions_es_index, info_all
)
if args.decisions_type == "csv":
opl.investigator.csv_decisions.store(args.decisions_filename, info_all)
decision_type = args.decisions_type.split(",")
for d_type in decision_type:
if d_type.strip() == "elasticsearch":
opl.investigator.elasticsearch_decisions.store(
args.decisions_es_server, args.decisions_es_index, info_all
)
if d_type.strip() == "csv":
opl.investigator.csv_decisions.store(args.decisions_filename, info_all)

if not args.dry_run:
if exit_code == 0:
Expand Down

0 comments on commit acc05c7

Please sign in to comment.