Skip to content

Commit

Permalink
emit notifications when a request completes
Browse files Browse the repository at this point in the history
  • Loading branch information
AparnaKarve committed Sep 21, 2018
1 parent 8a84384 commit 1006ba4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/models/service_template_transformation_plan_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@ def cancel
update_attributes(:cancelation_status => MiqRequest::CANCEL_STATUS_REQUESTED)
miq_request_tasks.each(&:cancel)
end

def update_request_status
super
if request_state == 'finished' && status == 'Ok'
call_automate_event_queue("request_completed_with_success")
elsif request_state == 'finished' && status != 'Ok'
call_automate_event_queue("request_completed_with_failure")
end
end
end

0 comments on commit 1006ba4

Please sign in to comment.