Skip to content

Commit

Permalink
fix(docker-compose-parser): fix python py_module healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
EspenAlbert committed Sep 27, 2023
1 parent 93bff16 commit ef83542
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions _pants/py_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


def as_healthcheck_command(healthcheck: dict) -> str:
"""only healthchecks with port and path are supported now"""
"""only healthchecks with port/py_module/cmd are supported now"""
cmd = healthcheck.get("cmd", healthcheck.get("CMD"))
port = healthcheck.get("port")
path = healthcheck.get("path", "/")
Expand All @@ -40,7 +40,7 @@ def as_healthcheck_command(healthcheck: dict) -> str:
elif py_module:
script_path = py_module.replace(".", "/")
healthcheck["python_major_minor"] = PYTHON_MAJOR_MINOR
cmd = f"/bin/app/lib/python{PYTHON_MAJOR_MINOR}/site-packages/{script_path}.py"
cmd = f"python /bin/app/lib/python{PYTHON_MAJOR_MINOR}/site-packages/{script_path}.py"
options = " ".join(
f"--{name}={healthcheck.get(name, default)}"
for name, default in default_healthcheck_options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _find_test(healthcheck: dict) -> Optional[str]:
elif py_module:
script_path = py_module.replace(".", "/")
py_major_minor = healthcheck["python_major_minor"]
cmd = f"/bin/app/lib/python{py_major_minor}/site-packages/{script_path}.py"
cmd = f"python /bin/app/lib/python{py_major_minor}/site-packages/{script_path}.py"
else:
raise NotImplementedError # should never happen, if condition
return cmd
Expand Down

0 comments on commit ef83542

Please sign in to comment.