Class/Module Index [+]

Quicksearch

HammerCLIForeman::OperatingSystem::DeleteOsDefaultTemplate

Public Instance Methods

base_action_params() click to toggle source
# File lib/hammer_cli_foreman/operating_system.rb, line 229
def base_action_params
  {"operatingsystem_id" => option_id}
end
execute() click to toggle source
# File lib/hammer_cli_foreman/operating_system.rb, line 212
def execute
  templates = HammerCLIForeman.collection_to_common_format(resource.call(:index, base_action_params))
  tpl = templates.find { |p| p["template_kind_name"] == option_type }

  if tpl.nil?
    raise RuntimeError.new(_("Default template of type %s not found") % option_type)
  end

  params = {
    "id" => tpl["id"]
  }.merge base_action_params

  HammerCLIForeman.record_to_common_format(resource.call(:destroy, params))
  print_message success_message if success_message
  HammerCLI::EX_OK
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.