Skip to content

Commit

Permalink
Don't create retire subtask for ServiceTemplate
Browse files Browse the repository at this point in the history
  • Loading branch information
d-m-u committed Nov 9, 2018
1 parent a6d4569 commit 17f25de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/service_retire_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ def after_request_task_create

def create_retire_subtasks(parent_service, parent_task)
parent_service.service_resources.collect do |svc_rsc|
next unless svc_rsc.resource.try(:retireable?)
next unless svc_rsc.resource.present? && svc_rsc.resource.try(:retireable?)
next if svc_rsc.resource_type == "ServiceTemplate" &&
!self.class.include_service_template?(self,
svc_rsc.resource.id,
parent_service)
# TODO: the next line deals with the filtering for provisioning
# (https://github.com/ManageIQ/manageiq/blob/3921e87915b5a69937b9d4a70bb24ab71b97c165/app/models/service_template/filter.rb#L5)
# which should be extended to retirement as part of later work
Expand Down

0 comments on commit 17f25de

Please sign in to comment.