Class: Actions::ForemanTemplateTasks::TemplateImportAction

Inherits:
TemplateAction
  • Object
show all
Defined in:
app/lib/actions/foreman_template_tasks/template_import_action.rb

Instance Method Summary collapse

Methods inherited from TemplateAction

#_plan, cleanup_after, #delay, #humanized_name, #humanized_output, #plan, #rescue_strategy, #task_output

Instance Method Details

#humanized_actionObject



12
13
14
# File 'app/lib/actions/foreman_template_tasks/template_import_action.rb', line 12

def humanized_action
  'Import'
end

#runObject



7
8
9
10
# File 'app/lib/actions/foreman_template_tasks/template_import_action.rb', line 7

def run
  importer = ForemanTemplates::TemplateImporter.new(input[:task_params])
  output[:results] = importer.import![:results].map(&:to_h)
end