From e0f20be7a17d681a2cdeb0978f41a353a0f73d1f Mon Sep 17 00:00:00 2001 From: spadakan Date: Mon, 15 Jan 2024 07:42:37 -0500 Subject: [PATCH] updated files with more comments --- opl/investigator/config.py | 6 +++--- opl/investigator/elasticsearch_decisions.py | 4 ++-- opl/pass_or_fail.py | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/opl/investigator/config.py b/opl/investigator/config.py index 08a9d0f..4f94cc6 100644 --- a/opl/investigator/config.py +++ b/opl/investigator/config.py @@ -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"] diff --git a/opl/investigator/elasticsearch_decisions.py b/opl/investigator/elasticsearch_decisions.py index 1996e00..1b50b93 100644 --- a/opl/investigator/elasticsearch_decisions.py +++ b/opl/investigator/elasticsearch_decisions.py @@ -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", "") diff --git a/opl/pass_or_fail.py b/opl/pass_or_fail.py index 410d72f..9fa4880 100755 --- a/opl/pass_or_fail.py +++ b/opl/pass_or_fail.py @@ -114,7 +114,7 @@ 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( @@ -122,8 +122,8 @@ def main(): 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": @@ -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 ), )