gluent / goe

GOE: a simple and flexible way to copy data from an Oracle Database to Google BigQuery.
Apache License 2.0
8 stars 2 forks source link

Refactor multiple copies of same OFFLOAD_HOME check #93

Open nj1973 opened 7 months ago

nj1973 commented 7 months ago

At the start of our entry points we have code to check that OFFLOAD_HOME is set. e.g.:

if not os.environ.get("OFFLOAD_HOME"):
    print("OFFLOAD_HOME environment variable missing")
    print("You should source environment variables first, eg: . ../conf/offload.env")
    sys.exit(1)

This code is duplicated:

./src/goe/config/config_checks.py.check_cli_path() should be the single point of truth, we should:

  1. Change bin/connect to use check_cli_path()
  2. Change anywhere that uses misc_functions.check_offload_env() to use check_cli_path()
  3. Remove misc_functions.check_offload_env()