diff --git a/app/models/service.rb b/app/models/service.rb index df6934320f4..583fd912ba7 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -218,10 +218,6 @@ def composite? children.present? end - def retireable? - type.present? - end - def atomic? children.empty? end diff --git a/app/models/service_retire_task.rb b/app/models/service_retire_task.rb index a9a7435c3cb..2241f02470f 100644 --- a/app/models/service_retire_task.rb +++ b/app/models/service_retire_task.rb @@ -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 @@ -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!