Skip to content

Commit

Permalink
Fixes #30526 - provisioning templates will be taken from CR in HG too
Browse files Browse the repository at this point in the history
  • Loading branch information
shiramax authored and tbrisker committed Aug 2, 2020
1 parent c39835f commit 2058a4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/concerns/hostext/operating_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def available_template_kinds(provisioning = nil)

def template_kinds(provisioning = nil)
return TemplateKind.all unless provisioning == 'image'
cr = ComputeResource.find_by_id(compute_resource_id)
cr_id = compute_resource_id || hostgroup&.compute_resource_id
cr = ComputeResource.find_by_id(cr_id)
images = cr.try(:images)
if images.blank?
[TemplateKind.friendly.find('finish')]
Expand Down

0 comments on commit 2058a4f

Please sign in to comment.