From 770c943d2aed0a1b1c6d59e85504e2aa33c399c5 Mon Sep 17 00:00:00 2001 From: "Eric D. Helms" Date: Fri, 6 Oct 2023 15:55:42 -0400 Subject: [PATCH 1/2] Fixes #36809 - Do not clobber answers provided on the command line with --certs-regenerate --- hooks/pre_exit/20-certs_regenerate.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hooks/pre_exit/20-certs_regenerate.rb b/hooks/pre_exit/20-certs_regenerate.rb index ba7d7fb8c..90358af97 100644 --- a/hooks/pre_exit/20-certs_regenerate.rb +++ b/hooks/pre_exit/20-certs_regenerate.rb @@ -1,6 +1,9 @@ if module_enabled?('certs') && param('certs', 'regenerate').value == true - answers = kafo.config.answers - answers['certs']['regenerate'] = false + kafo.config.modules.each do |mod| + if mod.identifier == 'certs' + mod.params_hash['regenerate'] = false + end + end - kafo.config.store(answers) + kafo.send(:store_params) end From 147f8376b9851f02d15cc3275f65e388a5f2ce5d Mon Sep 17 00:00:00 2001 From: Eric Helms Date: Tue, 30 Jul 2024 15:43:47 -0400 Subject: [PATCH 2/2] Update hooks/pre_exit/20-certs_regenerate.rb Co-authored-by: Ewoud Kohl van Wijngaarden --- hooks/pre_exit/20-certs_regenerate.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/pre_exit/20-certs_regenerate.rb b/hooks/pre_exit/20-certs_regenerate.rb index 90358af97..6782b5915 100644 --- a/hooks/pre_exit/20-certs_regenerate.rb +++ b/hooks/pre_exit/20-certs_regenerate.rb @@ -1,4 +1,4 @@ -if module_enabled?('certs') && param('certs', 'regenerate').value == true +if !app_value(:noop) && !app_value(:dont_save_answers) && module_enabled?('certs') && param('certs', 'regenerate').value == true kafo.config.modules.each do |mod| if mod.identifier == 'certs' mod.params_hash['regenerate'] = false