Skip to content

Commit

Permalink
Merge pull request #20773 from d-m-u/no_postprocess_without_job
Browse files Browse the repository at this point in the history
don't call postprocess without job in playbook on_error
  • Loading branch information
kbrock authored Nov 4, 2020
2 parents 3493002 + 574fcd9 commit 19f3728
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/models/service_ansible_playbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,12 @@ def postprocess(action)
def on_error(action)
_log.info("on_error called for service action: #{action}")
update(:retirement_state => 'error') if action == "Retirement"
job(action).try(:refresh_ems)
postprocess(action)
if job(action)
job(action).try(:refresh_ems)
postprocess(action)
else
_log.info("postprocess not called because job was nil")
end
end

def retain_resources_on_retirement?
Expand Down

0 comments on commit 19f3728

Please sign in to comment.