Skip to content

Commit

Permalink
Remove doubled service bundle children retirement call from RAAR
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed Aug 28, 2018
1 parent 5f129ad commit d4b353e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/service_retire_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ def after_request_task_create
parent_svc = Service.find_by(:id => options[:src_ids])
_log.info("- creating service tasks for service <#{self.class.name}:#{id}>")

create_retire_subtasks(parent_svc)
create_retire_subtasks(parent_svc, self)
end

def create_retire_subtasks(parent_service)
parent_service.direct_service_children.each { |child| create_retire_subtasks(child) }
def create_retire_subtasks(parent_service, task)
parent_service.service_resources.collect do |svc_rsc|
next unless svc_rsc.resource.try(:retireable?)
# TODO: the next line deals with the filtering for provisioning
Expand All @@ -42,6 +41,7 @@ def create_retire_subtasks(parent_service)
# Initial Options[:dialog] to an empty hash so we do not pass down dialog values to child services tasks
nh['options'][:dialog] = {}
new_task = create_task(svc_rsc, parent_service, nh)
create_retire_subtasks(svc_rsc.resource, new_task) if svc_rsc.resource.kind_of?(Service)
new_task.after_request_task_create
miq_request.miq_request_tasks << new_task
new_task.deliver_to_automate
Expand Down

0 comments on commit d4b353e

Please sign in to comment.