Skip to content

Commit

Permalink
based off review
Browse files Browse the repository at this point in the history
  • Loading branch information
daveads committed Oct 15, 2024
1 parent e796e94 commit ee59f99
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/opal-client/opal_client/engine/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,15 @@ def command(self) -> str:
opts_string = " ".join([f"{k}={v}" for k, v in opts.items()])
startup_files = self._options.get_opa_startup_files()
opa_path = self._options.opa_executable_path

# Check if the OPA executable exists and is a file
if not os.path.isfile(opa_path):
raise FileNotFoundError(f"OPA executable not found at path: {opa_path}")

opts = self._options.get_cli_options_dict()
opts_string = " ".join([f"{k}={v}" for k, v in opts.items()])
startup_files = self._options.get_opa_startup_files()

return f"{opa_path} run --server {opts_string} {startup_files}".strip()


Expand Down Expand Up @@ -284,6 +293,10 @@ def setup_opa_runner(
elif options.opa_executable_path == "opa":
options.opa_executable_path = opal_client_config.INLINE_OPA_EXECUTABLE_PATH

# Check if the OPA executable exists and is a file
if not os.path.isfile(options.opa_executable_path):
raise FileNotFoundError(f"OPA executable not found at path: {options.opa_executable_path}")


opa_runner = OpaRunner(options=options, piped_logs_format=piped_logs_format)
if initial_start_callbacks:
Expand Down

0 comments on commit ee59f99

Please sign in to comment.