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

(cherry picked from commit 19f3728)

https://bugzilla.redhat.com/show_bug.cgi?id=1835226
  • Loading branch information
kbrock authored and simaishi committed Nov 9, 2020
1 parent 3ae0f41 commit 558a27f
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_attributes(: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 558a27f

Please sign in to comment.