lst_auto_rta.utils.subprocess.subprocess_run_and_raise_exception_on_error

lst_auto_rta.utils.subprocess.subprocess_run_and_raise_exception_on_error(sp_cmd, success_log_string=None, failure_log_string=None, error_level=50, log_level=20)[source]

Run a subprocess, and print its output in case of error.

Parameters:
  • sp_cmd (list of str) – The subprocess command.

  • success_log_string (str, optional) – String to log when the subprocess succeeds. Defaults value is None, nothing is logged.

  • failure_log_string (str, optional) – String to log when the subprocess fails. Defaults value is None, nothing is logged.

Raises:

ChildProcessError – If the subprocess returns a non-exit code.