Skip to content

Commit

Permalink
updated files with more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sarathbrp committed Jan 15, 2024
1 parent a0358ca commit e0f20be
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions opl/investigator/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def load_config(conf, fp):
conf.history_es_index = data["history"]["es_index"]
conf.history_es_query = data["history"]["es_query"]
if "es_server_user" in data["history"]:
conf.es_server_user = data["history"]["es_server_user"]
conf.es_server_pass_env_var = data["history"]["es_server_pass_env_var"]
conf.es_server_verify = data["history"]["es_server_verify"]
conf.history_es_server_user = data["history"]["es_server_user"]
conf.history_es_server_pass_env_var = data["history"]["es_server_pass_env_var"]
conf.history_es_server_verify = data["history"]["es_server_verify"]

if conf.history_type == "sd_dir":
conf.history_dir = data["history"]["dir"]
Expand Down
4 changes: 2 additions & 2 deletions opl/investigator/elasticsearch_decisions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@


def store(server, index, decisions, **kwargs):
es_server_user = kwargs.get("es_server_user")
decisions_es_server_pass_env_var = kwargs.get("es_server_pass")
es_server_user = kwargs.get("decisions_es_server_user")
decisions_es_server_pass_env_var = kwargs.get("es_server_pass_env_var")
# This is our workaround on how to add additional metadata about the decision
job_name = os.environ.get("JOB_NAME", "")
build_url = os.environ.get("BUILD_URL", "")
Expand Down
12 changes: 6 additions & 6 deletions opl/pass_or_fail.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,16 @@ def main():
if args.history_type == "csv":
history = opl.investigator.csv_loader.load(args.history_file, args.sets)
elif args.history_type == "elasticsearch":
if hasattr(args, "es_server_verify"):
if hasattr(args, "history_es_server_verify") and not args.history_es_server_verify:
# SSL verification is disabled by default
opl.http.insecure()
history = opl.investigator.elasticsearch_loader.load(
args.history_es_server,
args.history_es_index,
args.history_es_query,
args.sets,
es_server_user=getattr(args, "es_server_user", None),
es_server_pass_env_var=getattr(args, "es_server_pass_env_var", None),
es_server_user=getattr(args, "history_es_server_user", None),
es_server_pass_env_var=getattr(args, "history_es_server_pass_env_var", None),
)

elif args.history_type == "sd_dir":
Expand Down Expand Up @@ -206,15 +206,15 @@ def main():
if not args.dry_run:
for d_type in args.decisions_type:
if d_type == "elasticsearch":
if hasattr(args, "es_server_verify"):
if hasattr(args, "es_server_verify") and not args.es_server_verify:
# disable SSL verification
opl.http.insecure()
opl.investigator.elasticsearch_decisions.store(
args.decisions_es_server,
args.decisions_es_index,
info_all,
es_server_user=getattr(args, "decisions_es_server_user", None),
decisions_es_server_pass_env_var=getattr(
decisions_es_server_user=getattr(args, "decisions_es_server_user", None),
es_server_pass_env_var=getattr(
args, "decisions_es_server_pass_env_var", None
),
)
Expand Down

0 comments on commit e0f20be

Please sign in to comment.