Skip to content

Commit

Permalink
not all bakeries give job_id + job_name logging
Browse files Browse the repository at this point in the history
  • Loading branch information
cisaacstern committed Nov 15, 2023
1 parent eb44c03 commit 3ed1c9b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions action/deploy_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,16 @@ def deploy_recipe_cmd(cmd: list[str]):
"""Wrapper for `call_subprocess_run` with extra stdout parsing when deploying recipes."""
stdout = call_subprocess_run(cmd)
lastline = json.loads(stdout.splitlines()[-1])
job_id = lastline["job_id"]
job_name = lastline["job_name"]
print(f"Job submitted with {job_id = } and {job_name = }")
if all([k in lastline for k in ("job_id", "job_name")]):
job_id = lastline["job_id"]
job_name = lastline["job_name"]
print(f"Job submitted with {job_id = } and {job_name = }")
else:
print(
"Keys 'job_id' and/or 'job_name' missing from deploy recipe process stdout, "
"but deploy command did not fail. Perhaps the configured bakery type does not "
"provide this logging information?"
)


def main():
Expand Down

0 comments on commit 3ed1c9b

Please sign in to comment.