foreman_rescue 2.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c9291994048aefb65f00e2f4c94461a823941d3f415e6d52d43ada93e5766a5
4
- data.tar.gz: 12ddd227e7065bfc45fb668e6296490763a52b9e8e290fc13e9b5f0b1fb191cd
3
+ metadata.gz: 30d69cfe2978f5b7b6a4f3604151d8d83ab5fcee0a5245ce845798ada48ea10c
4
+ data.tar.gz: 37cbc08534f2b5cada7d57f8988a5f36a60ae38b244e1ee7c6c076487e51d9fc
5
5
  SHA512:
6
- metadata.gz: f2bb66ec002dea21df1499897ed5b54a889c68ea89a45464e9c089064e71fe8a457353a63177a8af5a2cee185bb5c81bf16b774bf11218c72bf1d6536a284a79
7
- data.tar.gz: ea6ad609f4201f95f2b472c7636ce4a054a8f7c807de3b04d1d5392425810d5f42d62b9c33f6c8c32894072a012853a13cf4a5ac6a716a55f483b959a92af65f
6
+ metadata.gz: cf8c408b71e8d5369c027d11909369152f1ece087658579b3874b55d6e3306448597f17cadab4cba0ee47ae15da5acf8f854dcece077acdd1dcdabf84101bcdc
7
+ data.tar.gz: fc5b71b96991fd3f42b66bdb8dc2fac9b3173214420273c4d76f5b3bd3b6bbdb7f570a11540cbdca268305983799432656b3ada028fd04d838edbf7cc060124f
data/README.md CHANGED
@@ -11,6 +11,8 @@ This plugin allows a user to boot a Foreman host into a rescue system via PXE.
11
11
  | >= 1.15 | ~> 0.1 |
12
12
  | >= 1.17 | ~> 1.0 |
13
13
  | >= 1.20 | ~> 2.0 |
14
+ | >= 1.21 | ~> 3.0 |
15
+ | >= 3.9 | ~> 4.0 |
14
16
 
15
17
  ## Installation
16
18
 
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
20
20
  rdoc.rdoc_files.include('lib/**/*.rb')
21
21
  end
22
22
 
23
- APP_RAKEFILE = File.expand_path('../test/dummy/Rakefile', __FILE__)
23
+ APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
24
24
 
25
25
  Bundler::GemHelper.install_tasks
26
26
 
@@ -38,7 +38,7 @@ task default: :test
38
38
  begin
39
39
  require 'rubocop/rake_task'
40
40
  RuboCop::RakeTask.new
41
- rescue => _
41
+ rescue StandardError
42
42
  puts 'Rubocop not loaded.'
43
43
  end
44
44
 
@@ -1,9 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ForemanRescue
2
4
  class HostsController < ::HostsController
3
5
  before_action :find_resource, :only => [:rescue, :set_rescue, :cancel_rescue]
4
6
  define_action_permission ['rescue', 'set_rescue', 'cancel_rescue'], :rescue
5
7
 
6
- def rescue; end
8
+ def rescue
9
+ end
7
10
 
8
11
  def set_rescue
9
12
  forward_url_options
@@ -16,10 +19,10 @@ module ForemanRescue
16
19
  _('Enabled %s for boot into rescue system on next boot, but failed to power cycle the host.')
17
20
  end
18
21
  process_success :success_msg => message % @host, :success_redirect => :back
19
- rescue StandardError => error
22
+ rescue StandardError => e
20
23
  message = _('Failed to reboot %s.') % @host
21
24
  warning(message)
22
- Foreman::Logging.exception(message, error)
25
+ Foreman::Logging.exception(message, e)
23
26
  process_success :success_msg => _('Enabled %s for rescue system on next boot.') % @host, :success_redirect => :back
24
27
  end
25
28
  else
@@ -35,8 +38,10 @@ module ForemanRescue
35
38
  process_success :success_msg => _('Canceled booting into rescue system for %s.') % @host.name, :success_redirect => :back
36
39
  else
37
40
  process_error :redirect => :back,
38
- :error_msg => _('Failed to cancel booting into rescue system for %{hostname} with the following errors: %{errors}') %
39
- { :hostname => @host.name, :errors => @host.errors.full_messages.to_sentence }
41
+ :error_msg => _('Failed to cancel booting into rescue system for %{hostname} with the following errors: %{errors}') % {
42
+ :hostname => @host.name,
43
+ :errors => @host.errors.full_messages.to_sentence,
44
+ }
40
45
  end
41
46
  end
42
47
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ForemanRescue
2
4
  module HostsHelperExtensions
3
5
  def host_title_actions(host)
@@ -5,15 +7,15 @@ module ForemanRescue
5
7
  button_group(
6
8
  if host.rescue_mode?
7
9
  link_to_if_authorized(_('Cancel rescue'), hash_for_cancel_rescue_host_path(:id => host).merge(:auth_object => host, :permission => 'rescue_hosts'),
8
- :disabled => host.can_be_rescued?,
9
- :title => _('Cancel rescue system for this host.'),
10
- :class => 'btn btn-default',
11
- :method => :put)
10
+ :disabled => host.can_be_rescued?,
11
+ :title => _('Cancel rescue system for this host.'),
12
+ :class => 'btn btn-default',
13
+ :method => :put)
12
14
  else
13
15
  link_to_if_authorized(_('Rescue'), hash_for_rescue_host_path(:id => host).merge(:auth_object => host, :permission => 'rescue_hosts'),
14
- :disabled => !host.can_be_rescued?,
15
- :title => _('Activate rescue mode for this host.'),
16
- :class => 'btn btn-default')
16
+ :disabled => !host.can_be_rescued?,
17
+ :title => _('Activate rescue mode for this host.'),
18
+ :class => 'btn btn-default')
17
19
  end
18
20
  )
19
21
  )
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ForemanRescue
2
4
  module HostExtensions
3
5
  def self.prepended(base)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ForemanRescue
2
4
  module Orchestration
3
5
  module TFTP
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ForemanRescue
4
+ module ProvisioningTemplateExtensions
5
+ def self.templates_by_kind(kind)
6
+ template_kind = TemplateKind.find_by(name: kind)
7
+ ProvisioningTemplate.where(:template_kind => template_kind).pluck(:name, :name).to_h
8
+ end
9
+ end
10
+ end
@@ -49,7 +49,7 @@ oses:
49
49
  end
50
50
 
51
51
  # kickstart repository for LiveOS
52
- options.push("method=#{@host.operatingsystem.medium_uri(@host)}")
52
+ options.push("method=#{medium_uri}")
53
53
 
54
54
  if host_param('blacklist')
55
55
  options.push("modprobe.blacklist=" + host_param('blacklist').gsub(' ', ''))
@@ -1,4 +1,29 @@
1
- <% title @host.to_label, icon(@host.operatingsystem) + @host.to_label %>
1
+ <%= breadcrumbs(
2
+ items:
3
+ [
4
+ {
5
+ caption: _('All Hosts'),
6
+ url: hosts_path
7
+ },
8
+ {
9
+ caption: {
10
+ text: @host.to_label,
11
+ icon: {
12
+ alt: label(@host.operatingsystem),
13
+ url: icon(@host.operatingsystem, path: true)
14
+ }
15
+ },
16
+ url: host_path(@host)
17
+ },
18
+ {
19
+ caption: _('Rescue Mode'),
20
+ }
21
+ ],
22
+ resource_url: api_hosts_path(thin: true),
23
+ switcher_item_url: rescue_host_path(':name'),
24
+ switchable: true
25
+ ) %>
26
+
2
27
  <div class="blank-slate-pf">
3
28
  <div class="blank-slate-pf-icon">
4
29
  <%= icon_text('medkit', '', :kind => 'fa', :class => @host.rescue_mode? ? 'text-success' : '') %>
data/config/routes.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Rails.application.routes.draw do
2
4
  constraints(:id => /[^\/]+/) do
3
5
  resources :hosts, controller: 'foreman_rescue/hosts', :only => [] do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class AddRescueModeToHost < ActiveRecord::Migration[4.2]
2
4
  def change
3
5
  add_column :hosts, :rescue_mode, :boolean, default: false, index: true
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ class MigrateRescueSettingsCategoryToDsl < ActiveRecord::Migration[6.0]
4
+ class MigrationSettings < ApplicationRecord
5
+ self.table_name = :settings
6
+ end
7
+
8
+ def up
9
+ MigrationSettings.where(category: 'Setting::Rescue').update_all(category: 'Setting') if column_exists?(
10
+ :settings, :category
11
+ )
12
+ end
13
+ end
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  User.as_anonymous_admin do
2
4
  templates = [
3
- { :name => 'Kickstart rescue PXELinux', :source => 'PXELinux/kickstart_rescue_pxelinux.erb', :template_kind => TemplateKind.find_by(:name => 'PXELinux') }
5
+ { :name => 'Kickstart rescue PXELinux', :source => 'PXELinux/kickstart_rescue_pxelinux.erb', :template_kind => TemplateKind.find_by(:name => 'PXELinux') },
4
6
  ]
5
7
 
6
8
  templates.each do |template|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ForemanRescue
2
4
  class Engine < ::Rails::Engine
3
5
  engine_name 'foreman_rescue'
@@ -12,20 +14,34 @@ module ForemanRescue
12
14
  end
13
15
  end
14
16
 
15
- initializer 'foreman_monitoring.load_default_settings',
16
- :before => :load_config_initializers do |_app|
17
- if begin
18
- Setting.table_exists?
19
- rescue StandardError
20
- false
21
- end
22
- require_dependency File.expand_path('../../../app/models/setting/rescue.rb', __FILE__)
23
- end
24
- end
17
+ initializer 'foreman_rescue.register_plugin', :before => :finisher_hook do |_app| # rubocop:disable Metrics/BlockLength
18
+ Foreman::Plugin.register :foreman_rescue do # rubocop:disable Metrics/BlockLength
19
+ requires_foreman '>= 3.9'
25
20
 
26
- initializer 'foreman_rescue.register_plugin', :before => :finisher_hook do |_app|
27
- Foreman::Plugin.register :foreman_rescue do
28
- requires_foreman '>= 1.20'
21
+ settings do
22
+ category :rescue, N_('Rescue') do
23
+ setting('rescue_pxelinux_tftp_template',
24
+ type: :string,
25
+ default: 'Kickstart rescue PXELinux',
26
+ full_name: N_('PXELinux rescue template'),
27
+ description: N_('PXELinux template used when booting rescue system'),
28
+ collection: proc { ProvisioningTemplate.templates_by_kind('PXELinux') })
29
+
30
+ setting('rescue_pxegrub_tftp_template',
31
+ type: :string,
32
+ default: '',
33
+ full_name: N_('PXEGrub rescue template'),
34
+ description: N_('PXEGrub template used when booting rescue system'),
35
+ collection: proc { ProvisioningTemplate.templates_by_kind('PXEGrub') })
36
+
37
+ setting('rescue_pxegrub2_tftp_template',
38
+ type: :string,
39
+ default: '',
40
+ full_name: N_('PXEGrub2 rescue template'),
41
+ description: N_('PXEGrub2 template used when booting rescue system'),
42
+ collection: proc { ProvisioningTemplate.templates_by_kind('PXEGrub2') })
43
+ end
44
+ end
29
45
 
30
46
  # Add permissions
31
47
  security_block :foreman_rescue do
@@ -35,13 +51,12 @@ module ForemanRescue
35
51
  end
36
52
 
37
53
  config.to_prepare do
38
- begin
39
- Host::Managed.send(:prepend, ForemanRescue::HostExtensions)
40
- HostsHelper.send(:prepend, ForemanRescue::HostsHelperExtensions)
41
- Nic::Managed.send(:prepend, ForemanRescue::Orchestration::TFTP)
42
- rescue StandardError => e
43
- Rails.logger.warn "ForemanRescue: skipping engine hook (#{e})"
44
- end
54
+ Host::Managed.prepend ForemanRescue::HostExtensions
55
+ HostsHelper.prepend ForemanRescue::HostsHelperExtensions
56
+ Nic::Managed.prepend ForemanRescue::Orchestration::TFTP
57
+ ProvisioningTemplate.prepend ForemanRescue::ProvisioningTemplateExtensions
58
+ rescue StandardError => e
59
+ Rails.logger.warn "ForemanRescue: skipping engine hook (#{e})"
45
60
  end
46
61
 
47
62
  rake_tasks do
@@ -51,7 +66,7 @@ module ForemanRescue
51
66
  end
52
67
 
53
68
  initializer 'foreman_rescue.register_gettext', after: :load_config_initializers do |_app|
54
- locale_dir = File.join(File.expand_path('../../..', __FILE__), 'locale')
69
+ locale_dir = File.join(File.expand_path('../..', __dir__), 'locale')
55
70
  locale_domain = 'foreman_rescue'
56
71
  Foreman::Gettext::Support.add_text_domain locale_domain, locale_dir
57
72
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module ForemanRescue
2
- VERSION = '2.0.1'.freeze
4
+ VERSION = '4.0.0'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'foreman_rescue/engine'
2
4
 
3
5
  module ForemanRescue
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake/testtask'
2
4
 
3
5
  # Tests
@@ -12,24 +14,4 @@ namespace :test do
12
14
  end
13
15
  end
14
16
 
15
- namespace :foreman_rescue do
16
- task :rubocop do
17
- begin
18
- require 'rubocop/rake_task'
19
- RuboCop::RakeTask.new(:rubocop_foreman_rescue) do |task|
20
- task.patterns = ["#{ForemanRescue::Engine.root}/app/**/*.rb",
21
- "#{ForemanRescue::Engine.root}/lib/**/*.rb",
22
- "#{ForemanRescue::Engine.root}/test/**/*.rb"]
23
- end
24
- rescue StandardError
25
- puts 'Rubocop not loaded.'
26
- end
27
-
28
- Rake::Task['rubocop_foreman_rescue'].invoke
29
- end
30
- end
31
-
32
17
  Rake::Task[:test].enhance ['test:foreman_rescue']
33
-
34
- load 'tasks/jenkins.rake'
35
- Rake::Task['jenkins:unit'].enhance ['test:foreman_rescue', 'foreman_rescue:rubocop'] if Rake::Task.task_defined?(:'jenkins:unit')
data/locale/gemspec.rb CHANGED
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Matches foreman_rescue.gemspec
2
- _('TODO: Description of ForemanRescue.')
4
+ _('Foreman Plugin to provide the ability to boot a host into a rescue system.')
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_plugin_helper'
2
4
 
3
5
  module ForemanRescue
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  FactoryBot.modify do
2
4
  factory :host do
3
5
  trait :rescue_mode do
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_plugin_helper'
2
4
 
3
5
  module ForemanRescue
@@ -27,7 +29,7 @@ module ForemanRescue
27
29
  def seed
28
30
  User.current = FactoryBot.build(:user, :admin => true,
29
31
  :organizations => [], :locations => [])
30
- load Rails.root.join('db', 'seeds.rb')
32
+ load Rails.root.join('db/seeds.rb')
31
33
  end
32
34
  end
33
35
  end
@@ -1,9 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'test_plugin_helper'
2
4
 
3
5
  class HostTest < ActiveSupport::TestCase
4
6
  setup do
5
7
  User.current = FactoryBot.build(:user, :admin)
6
- setup_settings
7
8
  disable_orchestration
8
9
  end
9
10
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This calls the main test_helper in Foreman-core
2
4
  require 'test_helper'
3
5
  require 'database_cleaner'
@@ -9,10 +11,6 @@ FactoryBot.reload
9
11
  # Foreman's setup doesn't handle cleaning up for Minitest::Spec
10
12
  DatabaseCleaner.strategy = :transaction
11
13
 
12
- def setup_settings
13
- Setting::Rescue.load_defaults
14
- end
15
-
16
14
  module Minitest
17
15
  class Spec
18
16
  before :each do
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'test_plugin_helper'
4
+ require 'unit/shared/access_permissions_test_base'
5
+
6
+ # Permissions are added in AccessPermissions with lists of controllers and
7
+ # actions that they enable access to. For non-admin users, we need to test
8
+ # that there are permissions available that cover every controller action, else
9
+ # it can't be delegated and this will lead to parts of the application that
10
+ # aren't functional for non-admin users.
11
+ #
12
+ # In particular, it's important that actions for AJAX requests are added to
13
+ # an appropriate permission so views using those requests function.
14
+ class AccessPermissionsTest < ActiveSupport::TestCase
15
+ include AccessPermissionsTestBase
16
+
17
+ check_routes(ForemanRescue::Engine.routes, [])
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rescue
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Goebel
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-29 00:00:00.000000000 Z
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -25,19 +25,19 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rubocop
28
+ name: theforeman-rubocop
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.52.0
33
+ version: 0.1.2
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.52.0
40
+ version: 0.1.2
41
41
  description: Foreman Plugin to provide the ability to boot a host into a rescue system.
42
42
  email:
43
43
  - timo.goebel@dm.de
@@ -52,11 +52,12 @@ files:
52
52
  - app/helpers/concerns/foreman_rescue/hosts_helper_extensions.rb
53
53
  - app/models/concerns/foreman_rescue/host_extensions.rb
54
54
  - app/models/concerns/foreman_rescue/orchestration/tftp.rb
55
- - app/models/setting/rescue.rb
55
+ - app/models/concerns/foreman_rescue/provisioning_template_extensions.rb
56
56
  - app/views/foreman/unattended/provisioning_templates/PXELinux/kickstart_rescue_pxelinux.erb
57
57
  - app/views/foreman_rescue/hosts/rescue.html.erb
58
58
  - config/routes.rb
59
59
  - db/migrate/20170901131321_add_rescue_mode_to_host.foreman_rescue.rb
60
+ - db/migrate/20240506132712_migrate_rescue_settings_category_to_dsl.rb
60
61
  - db/seeds.d/103-provisioning_templates.rb
61
62
  - lib/foreman_rescue.rb
62
63
  - lib/foreman_rescue/engine.rb
@@ -71,11 +72,12 @@ files:
71
72
  - test/lib/tasks/seeds_test.rb
72
73
  - test/models/host_test.rb
73
74
  - test/test_plugin_helper.rb
75
+ - test/unit/foreman_rescue/access_permissions_test.rb
74
76
  homepage: https://github.com/dm-drogeriemarkt/foreman_rescue
75
77
  licenses:
76
78
  - GPL-3.0
77
79
  metadata: {}
78
- post_install_message:
80
+ post_install_message:
79
81
  rdoc_options: []
80
82
  require_paths:
81
83
  - lib
@@ -83,21 +85,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
85
  requirements:
84
86
  - - ">="
85
87
  - !ruby/object:Gem::Version
86
- version: '0'
88
+ version: '2.7'
89
+ - - "<"
90
+ - !ruby/object:Gem::Version
91
+ version: '4'
87
92
  required_rubygems_version: !ruby/object:Gem::Requirement
88
93
  requirements:
89
94
  - - ">="
90
95
  - !ruby/object:Gem::Version
91
96
  version: '0'
92
97
  requirements: []
93
- rubyforge_project:
94
- rubygems_version: 2.7.6.2
95
- signing_key:
98
+ rubygems_version: 3.4.1
99
+ signing_key:
96
100
  specification_version: 4
97
101
  summary: Provides the ability to boot a host into a rescue system.
98
102
  test_files:
99
- - test/models/host_test.rb
103
+ - test/controllers/hosts_controller_test.rb
100
104
  - test/factories/host.rb
101
105
  - test/lib/tasks/seeds_test.rb
106
+ - test/models/host_test.rb
102
107
  - test/test_plugin_helper.rb
103
- - test/controllers/hosts_controller_test.rb
108
+ - test/unit/foreman_rescue/access_permissions_test.rb
@@ -1,45 +0,0 @@
1
- class Setting
2
- class Rescue < ::Setting
3
- BLANK_ATTRS.concat ['rescue_pxegrub_tftp_template', 'rescue_pxegrub2_tftp_template']
4
-
5
- def self.default_settings
6
- [
7
- set('rescue_pxelinux_tftp_template',
8
- N_('PXELinux template used when booting rescue system'),
9
- 'Kickstart rescue PXELinux', N_('PXELinux rescue template'), nil,
10
- :collection => proc { Setting::Rescue.templates('PXELinux') }),
11
- set('rescue_pxegrub_tftp_template',
12
- N_('PXEGrub template used when booting rescue system'),
13
- '', N_('PXEGrub rescue template'), nil,
14
- :collection => proc { Setting::Rescue.templates('PXEGrub') }),
15
- set('rescue_pxegrub2_tftp_template',
16
- N_('PXEGrub2 template used when booting rescue system'),
17
- '', N_('PXEGrub2 rescue template'), nil,
18
- :collection => proc { Setting::Rescue.templates('PXEGrub 2') })
19
- ]
20
- end
21
-
22
- def self.load_defaults
23
- # Check the table exists
24
- return unless super
25
-
26
- transaction do
27
- default_settings.each { |s| create! s.update(:category => 'Setting::Rescue') }
28
- end
29
-
30
- true
31
- end
32
-
33
- def self.templates(kind)
34
- template_kind = TemplateKind.find_by(name: kind)
35
- templates = ProvisioningTemplate.where(:template_kind => template_kind)
36
- templates.each_with_object({}) do |template, hsh|
37
- hsh[template.name] = template.name
38
- end
39
- end
40
-
41
- def self.humanized_category
42
- N_('Rescue System')
43
- end
44
- end
45
- end