Skip to content

Commit

Permalink
use passed in command
Browse files Browse the repository at this point in the history
  • Loading branch information
hubertdeng123 committed Nov 13, 2024
1 parent 0ac1f9d commit 0028b66
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions devservices/utils/docker_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,16 @@ def _get_docker_compose_commands_to_run(
return docker_compose_commands


def _run_cmd(cmd: list[str], env: dict[str, str]) -> subprocess.CompletedProcess[str]:
def _run_cmd(
cmd: list[str], env: dict[str, str], command: str
) -> subprocess.CompletedProcess[str]:
logger = logging.getLogger(LOGGER_NAME)
try:
logger.debug(f"Running command: {' '.join(cmd)}")
return subprocess.run(cmd, check=True, capture_output=True, text=True, env=env)
except subprocess.CalledProcessError as e:
raise DockerComposeError(

Check warning on line 234 in devservices/utils/docker_compose.py

View check run for this annotation

Codecov / codecov/patch

devservices/utils/docker_compose.py#L233-L234

Added lines #L233 - L234 were not covered by tests
command=" ".join(cmd),
command=command,
returncode=e.returncode,
stdout=e.stdout,
stderr=e.stderr,
Expand Down Expand Up @@ -270,7 +272,7 @@ def run_docker_compose_command(

with concurrent.futures.ThreadPoolExecutor() as executor:
futures = [
executor.submit(_run_cmd, cmd, current_env)
executor.submit(_run_cmd, cmd, current_env, command)
for cmd in docker_compose_commands
]
for future in concurrent.futures.as_completed(futures):
Expand Down

0 comments on commit 0028b66

Please sign in to comment.