From 2fc50d4fe026a9fd682ce39adea5b9d49407a5a4 Mon Sep 17 00:00:00 2001 From: Leos Stejskal Date: Sun, 6 Oct 2024 12:30:07 +0200 Subject: [PATCH] refs #37792 - :template_name in correct scope The template_name method must be under the Bootdisk scope, otherwise it overrides the method from Foreman and all templates (like Grub2 or Kickstart PXE) have name ForemanBootdisk. --- app/lib/foreman_bootdisk/scope/bootdisk.rb | 3 +++ app/lib/foreman_bootdisk/template_helpers.rb | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/lib/foreman_bootdisk/scope/bootdisk.rb b/app/lib/foreman_bootdisk/scope/bootdisk.rb index 418d15c..02e0633 100644 --- a/app/lib/foreman_bootdisk/scope/bootdisk.rb +++ b/app/lib/foreman_bootdisk/scope/bootdisk.rb @@ -3,6 +3,9 @@ module ForemanBootdisk module Scope class Bootdisk < ::Foreman::Renderer::Scope::Provisioning + def template_name + "Foreman Bootdisk" + end end end end diff --git a/app/lib/foreman_bootdisk/template_helpers.rb b/app/lib/foreman_bootdisk/template_helpers.rb index 35a6ab4..ad57f22 100644 --- a/app/lib/foreman_bootdisk/template_helpers.rb +++ b/app/lib/foreman_bootdisk/template_helpers.rb @@ -40,9 +40,5 @@ def bootdisk_chain_url(mac = host.try(:mac), action = 'iPXE') def bootdisk_raise(*args) raise ::Foreman::Exception.new(*args) end - - def template_name - "Foreman Bootdisk" - end end end