From 7560fdf4af6ceb79f459879948a46b6263015b4d Mon Sep 17 00:00:00 2001 From: Alexander Olofsson Date: Wed, 14 Dec 2022 14:42:32 +0100 Subject: [PATCH] Fixes #35868 - Stop using Katello unconditionally This should limit the use of the `Host#katello_agent_enable?` method to only when the Katello plugin is actually present on the Foreman install --- .../provisioning_templates/snippet/redhat_register.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/unattended/provisioning_templates/snippet/redhat_register.erb b/app/views/unattended/provisioning_templates/snippet/redhat_register.erb index 47cae0f8cc4..f6eff9adf22 100644 --- a/app/views/unattended/provisioning_templates/snippet/redhat_register.erb +++ b/app/views/unattended/provisioning_templates/snippet/redhat_register.erb @@ -82,7 +82,8 @@ description: | <% if registration_type == 'subscription_manager' %> <% atomic = @host.operatingsystem.respond_to?(:atomic) ? @host.operatingsystem.atomic? : host_param_true?('atomic') - redhat_install_agent = host_param_true?('redhat_install_agent', katello_agent_enabled?) + redhat_install_agent_fallback = plugin_present?('katello') && katello_agent_enabled? + redhat_install_agent = host_param_true?('redhat_install_agent', redhat_install_agent_fallback) if host_param('kt_activation_keys') subscription_manager_certpkg_url = subscription_manager_configuration_url(@host)