Skip to content

Commit

Permalink
Create subtasks for bundled bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed Dec 18, 2018
1 parent 316f6e8 commit fd5ce90
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 0 additions & 4 deletions app/models/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,6 @@ def composite?
children.present?
end

def retireable?
type.present?
end

def atomic?
children.empty?
end
Expand Down
5 changes: 3 additions & 2 deletions app/models/service_retire_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def task_active

def after_request_task_create
update_attributes(:description => get_description)
parent_svc = Service.find_by(:id => options[:src_ids])
parent_svc = Service.find_by(:id => options[:src_id] || options[:src_ids])
_log.info("- creating service tasks for service <#{self.class.name}:#{id}>")
create_retire_subtasks(parent_svc, self)
end
Expand All @@ -42,7 +42,8 @@ def create_retire_subtasks(parent_service, parent_task)
# 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, parent_task)
create_retire_subtasks(svc_rsc.resource, new_task) if svc_rsc.resource.kind_of?(Service)
create_retire_subtasks(svc_rsc.resource, parent_task) if svc_rsc.resource.kind_of?(Service)
new_task.after_request_task_create
miq_request.miq_request_tasks << new_task
new_task.tap(&:deliver_to_automate)
end.compact!
Expand Down

0 comments on commit fd5ce90

Please sign in to comment.