From 55d552a0984cf085f5bc1f7a7410f6adc4d14fb8 Mon Sep 17 00:00:00 2001 From: Alexander Olofsson <alexander.olofsson@liu.se> Date: Fri, 28 Oct 2022 13:25:06 +0200 Subject: [PATCH] Clean up template task action slightly --- app/lib/actions/foreman_template_tasks/template_action.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/lib/actions/foreman_template_tasks/template_action.rb b/app/lib/actions/foreman_template_tasks/template_action.rb index 5a768bd..8594f2f 100644 --- a/app/lib/actions/foreman_template_tasks/template_action.rb +++ b/app/lib/actions/foreman_template_tasks/template_action.rb @@ -47,18 +47,18 @@ module Actions out += if changes.any? "#{changes.count} templates changed" else - location = self.class == TemplateImportAction ? 'local' : 'remote' + location = is_a?(TemplateImportAction) ? 'local' : 'remote' "no changes to #{location} templates" end out += if exceptions.any? - ", #{output[:results].reject { |r| r[:exception].nil? }.count} templates skipped;\n- " + exceptions.join("\n- ") + ", #{output[:results].count { |r| !r[:exception].nil? }} templates skipped;\n- " + exceptions.join("\n- ") else '.' end if changes.any? - out += "\n\nTemplates changed:\n- " + changes.map { |ch| "#{ch[:type].camelcase} | #{ch[:name]}" }.join("\n- ") + out += "\n\nTemplates changed:\n- #{changes.map { |ch| "#{ch[:type].camelcase} | #{ch[:name]}" }.join("\n- ")}" end out -- GitLab