Skip to content

Commit

Permalink
run black
Browse files Browse the repository at this point in the history
  • Loading branch information
meganerd committed Sep 26, 2023
1 parent 0f28144 commit 9d99ca7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nautobot_chatops/workers/nautobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,14 +1170,16 @@ def init_job(dispatcher, job_name: str, kwargs: str = ""):
profile=profile,
**json_args,
)

if job_result and job_result.status == "FAILURE":
dispatcher.send_error(f"The requested job {job_name} failed to initiate. Result: {job_result.result}")
return (CommandStatusChoices.STATUS_FAILED, f'Job "{job_name}" failed to initiate. Result: {job_result.result}')

# TODO: need base-domain, this yields: /extras/job-results/<job_id>/
blocks = [
dispatcher.markdown_block(f"The requested job {job_class_path} was initiated! [`click here`]({job_result.get_absolute_url()}) to open the job."),
dispatcher.markdown_block(
f"The requested job {job_class_path} was initiated! [`click here`]({job_result.get_absolute_url()}) to open the job."
),
]

dispatcher.send_blocks(blocks)
Expand Down

0 comments on commit 9d99ca7

Please sign in to comment.