foreman_puppet 1.0.4 → 2.0.2

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.
Files changed (112) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/foreman_puppet/extensions/api_hostgroups_controller.rb +14 -16
  3. data/app/controllers/concerns/foreman_puppet/{api/import_puppetclasses_common_controller.rb → extensions/api_smart_proxies_controller.rb} +9 -3
  4. data/app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb +23 -1
  5. data/app/controllers/concerns/foreman_puppet/extensions/api_v2_hosts_controller.rb +15 -17
  6. data/app/controllers/concerns/foreman_puppet/extensions/hostgroups_controller_extensions.rb +3 -1
  7. data/app/controllers/concerns/foreman_puppet/extensions/hosts_controller_extensions.rb +0 -1
  8. data/app/controllers/concerns/foreman_puppet/extensions/parameters_hostgroup.rb +2 -8
  9. data/app/controllers/foreman_puppet/api/v2/environments_controller.rb +0 -1
  10. data/app/controllers/foreman_puppet/api/v2/hostgroup_classes_controller.rb +1 -1
  11. data/app/controllers/foreman_puppet/puppetclasses_controller.rb +1 -1
  12. data/app/helpers/foreman_puppet/environments_helper.rb +1 -1
  13. data/app/helpers/foreman_puppet/hosts_and_hostgroups_helper.rb +0 -5
  14. data/app/helpers/foreman_puppet/hosts_helper.rb +6 -10
  15. data/app/models/concerns/foreman_puppet/extensions/host.rb +2 -16
  16. data/app/models/concerns/foreman_puppet/extensions/hostgroup.rb +2 -7
  17. data/app/models/concerns/foreman_puppet/extensions/provisioning_template.rb +7 -12
  18. data/app/models/concerns/foreman_puppet/extensions/template_combination.rb +5 -10
  19. data/app/models/foreman_puppet/host_puppet_facet.rb +1 -1
  20. data/app/models/foreman_puppet/hostgroup_puppet_facet.rb +2 -0
  21. data/app/services/foreman_puppet/puppet_class_importer.rb +0 -6
  22. data/app/views/foreman_puppet/api/v2/host_puppet_facets/host_list.json.rabl +3 -0
  23. data/app/views/foreman_puppet/api/v2/hostgroup_puppet_facets/base.json.rabl +2 -0
  24. data/app/views/foreman_puppet/api/v2/hostgroup_puppet_facets/hostgroup_list.json.rabl +3 -0
  25. data/app/views/foreman_puppet/config_groups/index.html.erb +1 -1
  26. data/config/api_routes.rb +1 -9
  27. data/config/initializers/api_reroute.rb +73 -5
  28. data/db/migrate/20101121140000_add_environment_to_template_combinations.foreman_puppet.rb +1 -1
  29. data/db/migrate/20200803113803_migrate_environment_to_puppet_facet.foreman_puppet.rb +2 -0
  30. data/db/migrate/20200803113903_migrate_host_type_in_host_config_groups.foreman_puppet.rb +36 -20
  31. data/db/migrate/20201125113903_migrate_puppetclasses_to_facets.foreman_puppet.rb +0 -8
  32. data/db/migrate/20210924103241_remove_katello_id_from_environments.foreman_puppet.rb +5 -0
  33. data/db/migrate/20211111125003_drop_puppetclasses_direct_references.foreman_puppet.rb +11 -0
  34. data/db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb +10 -0
  35. data/db/migrate_foreman/{20090722141107_create_environments.rb → 20090722141107_create_environments.foreman_puppet.rb} +3 -3
  36. data/db/migrate_foreman/20090802062223_create_puppetclasses.foreman_puppet.rb +29 -0
  37. data/db/migrate_foreman/20090905150132_create_hostgroups_puppetclasses.foreman_puppet.rb +12 -0
  38. data/db/migrate_foreman/20110412103238_remove_unused_fields_from_puppet_classes.foreman_puppet.rb +9 -0
  39. data/db/migrate_foreman/20110712070522_create_host_class.foreman_puppet.rb +11 -0
  40. data/db/migrate_foreman/20120824142048_add_some_indexes.foreman_puppet.rb +21 -0
  41. data/db/migrate_foreman/{20120905095532_create_environment_classes.rb → 20120905095532_create_environment_classes.foreman_puppet.rb} +2 -2
  42. data/db/migrate_foreman/20121018152459_create_hostgroup_classes.foreman_puppet.rb +11 -0
  43. data/db/migrate_foreman/{20140407161817_create_config_groups.rb → 20140407161817_create_config_groups.foreman_puppet.rb} +0 -0
  44. data/db/migrate_foreman/{20140407162007_create_config_group_classes.rb → 20140407162007_create_config_group_classes.foreman_puppet.rb} +0 -0
  45. data/db/migrate_foreman/{20140407162059_create_host_config_groups.rb → 20140407162059_create_host_config_groups.foreman_puppet.rb} +0 -0
  46. data/db/migrate_foreman/{20161205142618_delete_orphaned_smart_class_parameters.rb → 20161205142618_delete_orphaned_smart_class_parameters.foreman_puppet.rb} +1 -1
  47. data/db/migrate_foreman/{20170109115157_fix_lookup_key_auditable_type.rb → 20170109115157_fix_lookup_key_auditable_type.foreman_puppet.rb} +0 -0
  48. data/db/migrate_foreman/20180816134832_cast_lookup_key_values.foreman_puppet.rb +5 -0
  49. data/db/migrate_foreman/20180831115634_add_uniqueness_to_puppetclass_name.foreman_puppet.rb +24 -0
  50. data/db/migrate_foreman/{20181023112532_add_environment_puppetclass_id.rb → 20181023112532_add_environment_puppetclass_id.foreman_puppet.rb} +1 -1
  51. data/db/migrate_foreman/{20181224174419_add_index_to_environment_class_by_lookup_key_and_puppetclass.rb → 20181224174419_add_index_to_environment_class_by_lookup_key_and_puppetclass.foreman_puppet.rb} +0 -0
  52. data/lib/foreman_puppet/engine.rb +4 -36
  53. data/lib/foreman_puppet/register.rb +49 -45
  54. data/lib/foreman_puppet/version.rb +1 -1
  55. data/lib/foreman_puppet.rb +1 -6
  56. data/locale/ca/LC_MESSAGES/foreman_puppet.mo +0 -0
  57. data/locale/ca/foreman_puppet.po +760 -0
  58. data/locale/cs_CZ/LC_MESSAGES/foreman_puppet.mo +0 -0
  59. data/locale/cs_CZ/foreman_puppet.edit.po +1085 -0
  60. data/locale/cs_CZ/foreman_puppet.po +823 -0
  61. data/locale/cs_CZ/foreman_puppet.po.time_stamp +0 -0
  62. data/locale/de/LC_MESSAGES/foreman_puppet.mo +0 -0
  63. data/locale/de/foreman_puppet.po +844 -0
  64. data/locale/en/LC_MESSAGES/foreman_puppet.mo +0 -0
  65. data/locale/en/foreman_puppet.edit.po +317 -162
  66. data/locale/en/foreman_puppet.po +119 -8
  67. data/locale/en_GB/LC_MESSAGES/foreman_puppet.mo +0 -0
  68. data/locale/en_GB/foreman_puppet.po +820 -0
  69. data/locale/es/LC_MESSAGES/foreman_puppet.mo +0 -0
  70. data/locale/es/foreman_puppet.po +827 -0
  71. data/locale/foreman_puppet.pot +376 -205
  72. data/locale/fr/LC_MESSAGES/foreman_puppet.mo +0 -0
  73. data/locale/fr/foreman_puppet.po +835 -0
  74. data/locale/gemspec.rb +1 -1
  75. data/locale/gl/LC_MESSAGES/foreman_puppet.mo +0 -0
  76. data/locale/gl/foreman_puppet.po +818 -0
  77. data/locale/it/LC_MESSAGES/foreman_puppet.mo +0 -0
  78. data/locale/it/foreman_puppet.po +822 -0
  79. data/locale/ja/LC_MESSAGES/foreman_puppet.mo +0 -0
  80. data/locale/ja/foreman_puppet.po +830 -0
  81. data/locale/ko/LC_MESSAGES/foreman_puppet.mo +0 -0
  82. data/locale/ko/foreman_puppet.po +819 -0
  83. data/locale/nl_NL/LC_MESSAGES/foreman_puppet.mo +0 -0
  84. data/locale/nl_NL/foreman_puppet.po +823 -0
  85. data/locale/pl/LC_MESSAGES/foreman_puppet.mo +0 -0
  86. data/locale/pl/foreman_puppet.po +822 -0
  87. data/locale/pt_BR/LC_MESSAGES/foreman_puppet.mo +0 -0
  88. data/locale/pt_BR/foreman_puppet.po +826 -0
  89. data/locale/ru/LC_MESSAGES/foreman_puppet.mo +0 -0
  90. data/locale/ru/foreman_puppet.po +827 -0
  91. data/locale/sv_SE/LC_MESSAGES/foreman_puppet.mo +0 -0
  92. data/locale/sv_SE/foreman_puppet.po +822 -0
  93. data/locale/zh_CN/LC_MESSAGES/foreman_puppet.mo +0 -0
  94. data/locale/zh_CN/foreman_puppet.po +831 -0
  95. data/locale/zh_TW/LC_MESSAGES/foreman_puppet.mo +0 -0
  96. data/locale/zh_TW/foreman_puppet.po +821 -0
  97. data/package.json +8 -11
  98. data/test/controllers/foreman_puppet/api/v2/environments_controller_test.rb +0 -231
  99. data/test/controllers/foreman_puppet/api/v2/smart_proxies_controller_test.rb +255 -0
  100. data/test/controllers/foreman_puppet/environments_controller_test.rb +2 -2
  101. data/test/controllers/foreman_puppet/hosts_controller_test.rb +0 -1
  102. data/test/factories/foreman_puppet_factories.rb +0 -2
  103. data/test/helpers/foreman_puppet/hosts_and_hostgroups_helper_test.rb +70 -31
  104. data/test/integration/foreman_puppet/dashboard_js_test.rb +31 -0
  105. data/test/integration/foreman_puppet/host_js_test.rb +0 -1
  106. data/test/integration/foreman_puppet/puppetclass_js_test.rb +1 -1
  107. data/test/models/foreman_puppet/host_puppet_facet_test.rb +7 -1
  108. data/test/models/foreman_puppet/host_test.rb +26 -0
  109. data/test/models/foreman_puppet/user_test.rb +1 -5
  110. data/test/unit/foreman_puppet/puppet_class_importer_test.rb +1 -1
  111. metadata +67 -15
  112. data/db/migrate_foreman/20180816134832_cast_lookup_key_values.rb +0 -35
@@ -9,49 +9,88 @@ module ForemanPuppet
9
9
  include HostsAndHostgroupsHelper
10
10
 
11
11
  describe 'puppet environment field' do
12
+ let(:fields) { mock('fields_for') }
13
+ let(:f) { mock('form_for') }
14
+ let(:object) { mock('object') }
15
+ let(:puppet_facet) { mock('puppet') }
16
+
12
17
  setup do
13
- @host = mock('host')
14
- puppet = mock('puppet')
15
- @host.stubs(:hostgroup)
16
- @host.stubs(:puppet).returns(puppet)
17
- @host.stubs(:id).returns(999)
18
- @f = mock('f')
19
- @f.stubs(:object).returns(@host)
20
- @fields = mock('fields')
21
- @fields.stubs(:object).returns(puppet)
22
- @f.stubs(:fields_for).yields(@fields)
18
+ f.stubs(:object).returns(object)
19
+ f.stubs(:fields_for).yields(fields)
20
+ fields.stubs(:object).returns(puppet_facet)
23
21
  end
24
22
 
25
- test 'it adds new first level attributes' do
26
- @fields.expects(:collection_select).with do |*attrs|
27
- select_options, html_options = extract_collection_options(attrs)
28
- select_options[:test_select_option] == 'test_value1' &&
29
- html_options[:test_html_option] == 'test_value2'
23
+ describe '#host_puppet_environment_field' do
24
+ let(:object) do
25
+ host = mock('host')
26
+ host.stubs(:hostgroup)
27
+ host.stubs(:puppet).returns(puppet_facet)
28
+ host.stubs(:id).returns(999)
29
+ host
30
30
  end
31
31
 
32
- host_puppet_environment_field(@f, { test_select_option: 'test_value1' }, { test_html_option: 'test_value2' })
33
- end
32
+ test 'it adds new first level attributes' do
33
+ fields.expects(:collection_select).with do |*attrs|
34
+ select_options, html_options = extract_collection_options(attrs)
35
+ select_options[:test_select_option] == 'test_value1' &&
36
+ html_options[:test_html_option] == 'test_value2'
37
+ end
34
38
 
35
- test 'it adds new data attributes' do
36
- @fields.expects(:collection_select).with do |*attrs|
37
- select_options, html_options = extract_collection_options(attrs)
38
- select_options[:test_select_option] == 'test_value1' &&
39
- html_options[:data][:test] == 'test_value2'
39
+ host_puppet_environment_field(f, { test_select_option: 'test_value1' }, { test_html_option: 'test_value2' })
40
40
  end
41
41
 
42
- host_puppet_environment_field(@f, { test_select_option: 'test_value1' }, { data: { test: 'test_value2' } })
42
+ test 'it adds new data attributes' do
43
+ fields.expects(:collection_select).with do |*attrs|
44
+ select_options, html_options = extract_collection_options(attrs)
45
+ select_options[:test_select_option] == 'test_value1' &&
46
+ html_options[:data][:test] == 'test_value2'
47
+ end
48
+
49
+ host_puppet_environment_field(f, { test_select_option: 'test_value1' }, { data: { test: 'test_value2' } })
50
+ end
51
+
52
+ test 'it overrides existing attributes' do
53
+ fields.expects(:collection_select).with do |*attrs|
54
+ html_options = attrs.pop
55
+ html_options[:data][:test] == 'some_test_value' &&
56
+ html_options[:data][:url] == '/test/url'
57
+ end.returns('')
58
+
59
+ html = host_puppet_environment_field(f, { disable_button: false }, { data: { url: '/test/url', test: 'some_test_value' } })
60
+
61
+ assert_no_match(/btn/, html)
62
+ end
43
63
  end
44
64
 
45
- test 'it overrides existing attributes' do
46
- @fields.expects(:collection_select).with do |*attrs|
47
- html_options = attrs.pop
48
- html_options[:data][:test] == 'some_test_value' &&
49
- html_options[:data][:url] == '/test/url'
50
- end.returns('')
65
+ describe '#hostgroup_puppet_environment_field' do
66
+ let(:object) { FactoryBot.build_stubbed(:hostgroup, parent: parent_hg) }
67
+ let(:puppet_facet) { object.puppet || object.build_puppet }
68
+
69
+ context 'parent without puppet' do
70
+ let(:parent_hg) { FactoryBot.create(:hostgroup) }
51
71
 
52
- html = host_puppet_environment_field(@f, { disable_button: false }, { data: { url: '/test/url', test: 'some_test_value' } })
72
+ it 'shows Inherit option with no value' do
73
+ fields.expects(:collection_select).with do |*attrs|
74
+ options = attrs.second
75
+ options.first.to_label == 'Inherit parent (no value)'
76
+ end.returns('')
77
+
78
+ hostgroup_puppet_environment_field(f)
79
+ end
80
+ end
53
81
 
54
- assert_no_match(/btn/, html)
82
+ context 'parent with puppet' do
83
+ let(:parent_hg) { FactoryBot.create(:hostgroup, :with_puppet_enc) }
84
+
85
+ it 'shows Inherit option with no value' do
86
+ fields.expects(:collection_select).with do |*attrs|
87
+ options = attrs.second
88
+ options.first.to_label == "Inherit parent (#{parent_hg.puppet.environment.name})"
89
+ end.returns('')
90
+
91
+ hostgroup_puppet_environment_field(f)
92
+ end
93
+ end
55
94
  end
56
95
  end
57
96
 
@@ -0,0 +1,31 @@
1
+ require 'test_puppet_helper'
2
+ require 'integration_test_helper'
3
+ require 'integration/shared/host_finders'
4
+ require 'integration/shared/host_orchestration_stubs'
5
+
6
+ module ForemanPuppet
7
+ class DashboardJSTest < IntegrationTestWithJavascript
8
+ setup do
9
+ Dashboard::Manager.reset_user_to_default(users(:admin))
10
+ Setting[:outofsync_interval] = 35
11
+ end
12
+
13
+ context 'with origin' do
14
+ setup do
15
+ Setting[:puppet_out_of_sync_disabled] = true
16
+ end
17
+
18
+ context 'out of sync disabled' do
19
+ test 'has no out of sync link' do
20
+ visit dashboard_path
21
+ wait_for_ajax
22
+ within "li[data-name='Host Configuration Status for Puppet']" do
23
+ assert page.has_no_link?('Out of sync hosts')
24
+ assert page.has_no_link?('Good host reports in the last')
25
+ assert page.has_link?('Good host with reports')
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
@@ -362,7 +362,6 @@ module ForemanPuppet
362
362
  page.find('#puppet_klasses_parameters_table')
363
363
  end
364
364
 
365
- # TODO: unless ForemanPuppet.extracted_from_core?
366
365
  def switch_form_tab_to_interfaces
367
366
  switch_form_tab('Interfaces')
368
367
  disable_interface_modal_animation
@@ -11,7 +11,7 @@ module ForemanPuppet
11
11
  let(:puppetclass) { FactoryBot.create(:puppetclass, environments: [environment]) }
12
12
 
13
13
  test 'edit page' do
14
- FactoryBot.create(:puppetclass, name: 'vim', environments: [environment]) if ForemanPuppet.extracted_from_core?
14
+ FactoryBot.create(:puppetclass, name: 'vim', environments: [environment])
15
15
  visit puppetclasses_path
16
16
  click_link 'vim'
17
17
  assert page.has_no_link? 'Common'
@@ -107,7 +107,13 @@ module ForemanPuppet
107
107
  test 'should return empty array if host has no hostgroup' do
108
108
  host = FactoryBot.create(:host, :with_puppet_enc)
109
109
  assert_not host.hostgroup
110
- assert_empty host.puppet.parent_config_groups
110
+ assert_equal [], host.puppet.parent_config_groups
111
+ end
112
+
113
+ test 'should return empty array if hostgroup do not have puppet data' do
114
+ hostgroup = FactoryBot.create(:hostgroup)
115
+ host = FactoryBot.create(:host, :with_puppet_enc, hostgroup: hostgroup)
116
+ assert_equal [], host.puppet.parent_config_groups
111
117
  end
112
118
  end
113
119
 
@@ -150,6 +150,32 @@ module ForemanPuppet
150
150
  end
151
151
  end
152
152
 
153
+ describe '#available_template_kinds' do
154
+ let(:template_kinds) { [stub(name: 'iPXE'), stub(name: 'finish')] }
155
+
156
+ test 'calls find_template with Puppet environment' do
157
+ host = FactoryBot.create(:host, :with_hostgroup, :with_puppet_enc)
158
+ host.expects(:template_kinds).returns(template_kinds)
159
+ template_kinds.each do |kind|
160
+ ::ProvisioningTemplate.expects(:find_template)
161
+ .with(kind: kind.name, operatingsystem_id: host.operatingsystem.id, hostgroup_id: host.hostgroup.id, environment_id: host.puppet.environment.id)
162
+ .returns(stub(name: "default #{kind.name}"))
163
+ end
164
+ assert_equal template_kinds.map { |k| "default #{k.name}" }, host.available_template_kinds.map(&:name)
165
+ end
166
+
167
+ test 'calls find_template without Puppet environment' do
168
+ host = FactoryBot.create(:host, :with_hostgroup)
169
+ host.expects(:template_kinds).returns(template_kinds)
170
+ template_kinds.each do |kind|
171
+ ::ProvisioningTemplate.expects(:find_template)
172
+ .with(kind: kind.name, operatingsystem_id: host.operatingsystem.id, hostgroup_id: host.hostgroup.id, environment_id: nil)
173
+ .returns(stub(name: "default #{kind.name}"))
174
+ end
175
+ assert_equal template_kinds.map { |k| "default #{k.name}" }, host.available_template_kinds.map(&:name)
176
+ end
177
+ end
178
+
153
179
  test 'should import from external nodes output' do
154
180
  # create a dummy node
155
181
  Parameter.destroy_all
@@ -5,11 +5,7 @@ module ForemanPuppet
5
5
  describe '#visible_environments' do
6
6
  let(:environment) { FactoryBot.create(:environment) }
7
7
  let(:untaxed_env) { FactoryBot.create(:environment, organizations: [], locations: []) }
8
- let(:env_names) do
9
- env_names = [environment.name, untaxed_env.name]
10
- env_names += %w[production global_puppetmaster testing] unless ForemanPuppet.extracted_from_core?
11
- env_names
12
- end
8
+ let(:env_names) { [environment.name, untaxed_env.name] }
13
9
 
14
10
  setup do
15
11
  environment
@@ -3,7 +3,7 @@ require 'test_puppet_helper'
3
3
  module ForemanPuppet
4
4
  class PuppetClassImporterTest < ActiveSupport::TestCase
5
5
  def setup
6
- FactoryBot.create(:environment, name: 'production') if ForemanPuppet.extracted_from_core?
6
+ FactoryBot.create(:environment, name: 'production')
7
7
  ProxyAPI::Puppet.any_instance.stubs(:environments).returns(%w[foreman-testing foreman-testing-1])
8
8
  ProxyAPI::Puppet.any_instance.stubs(:classes).returns(mocked_classes)
9
9
  User.current = users(:admin)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Ezr
@@ -9,9 +9,9 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-27 00:00:00.000000000 Z
12
+ date: 2021-12-28 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: Allow assigning Puppet environmets and classes to the Foreman Hosts.
14
+ description: Allow assigning Puppet environments and classes to the Foreman Hosts.
15
15
  email:
16
16
  - foreman-dev@googlegroups.com
17
17
  executables: []
@@ -22,10 +22,10 @@ files:
22
22
  - README.md
23
23
  - Rakefile
24
24
  - app/assets/stylesheets/foreman_puppet.scss
25
- - app/controllers/concerns/foreman_puppet/api/import_puppetclasses_common_controller.rb
26
25
  - app/controllers/concerns/foreman_puppet/environments_import.rb
27
26
  - app/controllers/concerns/foreman_puppet/extensions/api_base_controller.rb
28
27
  - app/controllers/concerns/foreman_puppet/extensions/api_hostgroups_controller.rb
28
+ - app/controllers/concerns/foreman_puppet/extensions/api_smart_proxies_controller.rb
29
29
  - app/controllers/concerns/foreman_puppet/extensions/api_template_combinations_controller.rb
30
30
  - app/controllers/concerns/foreman_puppet/extensions/api_v2_hosts_controller.rb
31
31
  - app/controllers/concerns/foreman_puppet/extensions/hostgroups_controller_extensions.rb
@@ -113,9 +113,11 @@ files:
113
113
  - app/views/foreman_puppet/api/v2/environments/show.json.rabl
114
114
  - app/views/foreman_puppet/api/v2/environments/update.json.rabl
115
115
  - app/views/foreman_puppet/api/v2/host_puppet_facets/base.json.rabl
116
+ - app/views/foreman_puppet/api/v2/host_puppet_facets/host_list.json.rabl
116
117
  - app/views/foreman_puppet/api/v2/host_puppet_facets/host_single.json.rabl
117
118
  - app/views/foreman_puppet/api/v2/host_puppet_facets/show.json.rabl
118
119
  - app/views/foreman_puppet/api/v2/hostgroup_puppet_facets/base.json.rabl
120
+ - app/views/foreman_puppet/api/v2/hostgroup_puppet_facets/hostgroup_list.json.rabl
119
121
  - app/views/foreman_puppet/api/v2/hostgroup_puppet_facets/hostgroup_single.json.rabl
120
122
  - app/views/foreman_puppet/api/v2/hostgroup_puppet_facets/show.json.rabl
121
123
  - app/views/foreman_puppet/api/v2/import_puppetclasses/index.json.rabl
@@ -183,16 +185,26 @@ files:
183
185
  - db/migrate/20200803113803_migrate_environment_to_puppet_facet.foreman_puppet.rb
184
186
  - db/migrate/20200803113903_migrate_host_type_in_host_config_groups.foreman_puppet.rb
185
187
  - db/migrate/20201125113903_migrate_puppetclasses_to_facets.foreman_puppet.rb
186
- - db/migrate_foreman/20090722141107_create_environments.rb
187
- - db/migrate_foreman/20120905095532_create_environment_classes.rb
188
- - db/migrate_foreman/20140407161817_create_config_groups.rb
189
- - db/migrate_foreman/20140407162007_create_config_group_classes.rb
190
- - db/migrate_foreman/20140407162059_create_host_config_groups.rb
191
- - db/migrate_foreman/20161205142618_delete_orphaned_smart_class_parameters.rb
192
- - db/migrate_foreman/20170109115157_fix_lookup_key_auditable_type.rb
193
- - db/migrate_foreman/20180816134832_cast_lookup_key_values.rb
194
- - db/migrate_foreman/20181023112532_add_environment_puppetclass_id.rb
195
- - db/migrate_foreman/20181224174419_add_index_to_environment_class_by_lookup_key_and_puppetclass.rb
188
+ - db/migrate/20210924103241_remove_katello_id_from_environments.foreman_puppet.rb
189
+ - db/migrate/20211111125003_drop_puppetclasses_direct_references.foreman_puppet.rb
190
+ - db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
191
+ - db/migrate_foreman/20090722141107_create_environments.foreman_puppet.rb
192
+ - db/migrate_foreman/20090802062223_create_puppetclasses.foreman_puppet.rb
193
+ - db/migrate_foreman/20090905150132_create_hostgroups_puppetclasses.foreman_puppet.rb
194
+ - db/migrate_foreman/20110412103238_remove_unused_fields_from_puppet_classes.foreman_puppet.rb
195
+ - db/migrate_foreman/20110712070522_create_host_class.foreman_puppet.rb
196
+ - db/migrate_foreman/20120824142048_add_some_indexes.foreman_puppet.rb
197
+ - db/migrate_foreman/20120905095532_create_environment_classes.foreman_puppet.rb
198
+ - db/migrate_foreman/20121018152459_create_hostgroup_classes.foreman_puppet.rb
199
+ - db/migrate_foreman/20140407161817_create_config_groups.foreman_puppet.rb
200
+ - db/migrate_foreman/20140407162007_create_config_group_classes.foreman_puppet.rb
201
+ - db/migrate_foreman/20140407162059_create_host_config_groups.foreman_puppet.rb
202
+ - db/migrate_foreman/20161205142618_delete_orphaned_smart_class_parameters.foreman_puppet.rb
203
+ - db/migrate_foreman/20170109115157_fix_lookup_key_auditable_type.foreman_puppet.rb
204
+ - db/migrate_foreman/20180816134832_cast_lookup_key_values.foreman_puppet.rb
205
+ - db/migrate_foreman/20180831115634_add_uniqueness_to_puppetclass_name.foreman_puppet.rb
206
+ - db/migrate_foreman/20181023112532_add_environment_puppetclass_id.foreman_puppet.rb
207
+ - db/migrate_foreman/20181224174419_add_index_to_environment_class_by_lookup_key_and_puppetclass.foreman_puppet.rb
196
208
  - db/seeds.d/111_puppet_proxy_feature.rb
197
209
  - lib/foreman_puppet.rb
198
210
  - lib/foreman_puppet/engine.rb
@@ -201,14 +213,50 @@ files:
201
213
  - lib/tasks/foreman_puppet_tasks.rake
202
214
  - locale/Makefile
203
215
  - locale/action_names.rb
216
+ - locale/ca/LC_MESSAGES/foreman_puppet.mo
217
+ - locale/ca/foreman_puppet.po
218
+ - locale/cs_CZ/LC_MESSAGES/foreman_puppet.mo
219
+ - locale/cs_CZ/foreman_puppet.edit.po
220
+ - locale/cs_CZ/foreman_puppet.po
221
+ - locale/cs_CZ/foreman_puppet.po.time_stamp
222
+ - locale/de/LC_MESSAGES/foreman_puppet.mo
223
+ - locale/de/foreman_puppet.po
204
224
  - locale/en/LC_MESSAGES/foreman_puppet.mo
205
225
  - locale/en/foreman_puppet.edit.po
206
226
  - locale/en/foreman_puppet.po
207
227
  - locale/en/foreman_puppet.po.time_stamp
208
228
  - locale/en/foreman_puppet.pox
229
+ - locale/en_GB/LC_MESSAGES/foreman_puppet.mo
230
+ - locale/en_GB/foreman_puppet.po
231
+ - locale/es/LC_MESSAGES/foreman_puppet.mo
232
+ - locale/es/foreman_puppet.po
209
233
  - locale/foreman_puppet.pot
234
+ - locale/fr/LC_MESSAGES/foreman_puppet.mo
235
+ - locale/fr/foreman_puppet.po
210
236
  - locale/gemspec.rb
237
+ - locale/gl/LC_MESSAGES/foreman_puppet.mo
238
+ - locale/gl/foreman_puppet.po
239
+ - locale/it/LC_MESSAGES/foreman_puppet.mo
240
+ - locale/it/foreman_puppet.po
241
+ - locale/ja/LC_MESSAGES/foreman_puppet.mo
242
+ - locale/ja/foreman_puppet.po
243
+ - locale/ko/LC_MESSAGES/foreman_puppet.mo
244
+ - locale/ko/foreman_puppet.po
211
245
  - locale/messages.mo
246
+ - locale/nl_NL/LC_MESSAGES/foreman_puppet.mo
247
+ - locale/nl_NL/foreman_puppet.po
248
+ - locale/pl/LC_MESSAGES/foreman_puppet.mo
249
+ - locale/pl/foreman_puppet.po
250
+ - locale/pt_BR/LC_MESSAGES/foreman_puppet.mo
251
+ - locale/pt_BR/foreman_puppet.po
252
+ - locale/ru/LC_MESSAGES/foreman_puppet.mo
253
+ - locale/ru/foreman_puppet.po
254
+ - locale/sv_SE/LC_MESSAGES/foreman_puppet.mo
255
+ - locale/sv_SE/foreman_puppet.po
256
+ - locale/zh_CN/LC_MESSAGES/foreman_puppet.mo
257
+ - locale/zh_CN/foreman_puppet.po
258
+ - locale/zh_TW/LC_MESSAGES/foreman_puppet.mo
259
+ - locale/zh_TW/foreman_puppet.po
212
260
  - package.json
213
261
  - test/controllers/foreman_puppet/api/v2/config_groups_controller_test.rb
214
262
  - test/controllers/foreman_puppet/api/v2/environments_controller_test.rb
@@ -221,6 +269,7 @@ files:
221
269
  - test/controllers/foreman_puppet/api/v2/provisioning_templates_controller_test.rb
222
270
  - test/controllers/foreman_puppet/api/v2/puppetclasses_controller_test.rb
223
271
  - test/controllers/foreman_puppet/api/v2/smart_class_parameters_controller_test.rb
272
+ - test/controllers/foreman_puppet/api/v2/smart_proxies_controller_test.rb
224
273
  - test/controllers/foreman_puppet/api/v2/template_combinations_controller_test.rb
225
274
  - test/controllers/foreman_puppet/config_groups_controller_test.rb
226
275
  - test/controllers/foreman_puppet/environments_controller_test.rb
@@ -244,6 +293,7 @@ files:
244
293
  - test/graphql/queries/puppetclasses_query_test.rb
245
294
  - test/helpers/foreman_puppet/hosts_and_hostgroups_helper_test.rb
246
295
  - test/helpers/foreman_puppet/puppetclasses_helper_test.rb
296
+ - test/integration/foreman_puppet/dashboard_js_test.rb
247
297
  - test/integration/foreman_puppet/environment_js_test.rb
248
298
  - test/integration/foreman_puppet/host_js_test.rb
249
299
  - test/integration/foreman_puppet/hostgroup_js_test.rb
@@ -316,7 +366,7 @@ requirements: []
316
366
  rubygems_version: 3.1.6
317
367
  signing_key:
318
368
  specification_version: 4
319
- summary: Adds puppet ENC features
369
+ summary: Add Puppet features to Foreman
320
370
  test_files:
321
371
  - test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
322
372
  - test/services/foreman_puppet/host_info_providers/puppet_info_test.rb
@@ -326,6 +376,7 @@ test_files:
326
376
  - test/integration/foreman_puppet/puppetclass_js_test.rb
327
377
  - test/integration/foreman_puppet/hostgroup_js_test.rb
328
378
  - test/integration/foreman_puppet/environment_js_test.rb
379
+ - test/integration/foreman_puppet/dashboard_js_test.rb
329
380
  - test/integration/foreman_puppet/host_js_test.rb
330
381
  - test/graphql/mutations/hosts/create_mutation_test.rb
331
382
  - test/graphql/queries/puppetclasses_query_test.rb
@@ -376,6 +427,7 @@ test_files:
376
427
  - test/controllers/foreman_puppet/api/v2/lookups_common_controller_test.rb
377
428
  - test/controllers/foreman_puppet/api/v2/host_classes_controller_test.rb
378
429
  - test/controllers/foreman_puppet/api/v2/provisioning_templates_controller_test.rb
430
+ - test/controllers/foreman_puppet/api/v2/smart_proxies_controller_test.rb
379
431
  - test/controllers/foreman_puppet/api/v2/puppetclasses_controller_test.rb
380
432
  - test/controllers/foreman_puppet/api/v2/hosts_controller_test.rb
381
433
  - test/controllers/foreman_puppet/puppetclasses_controller_test.rb
@@ -1,35 +0,0 @@
1
- class CastLookupKeyValues < ActiveRecord::Migration[5.1]
2
- def up
3
- # Different LookupKey types handle casting a bit differently
4
- PuppetclassLookupKey.unscoped.preload(:lookup_values).where(override: true).where.not(key_type: 'string').find_each do |key|
5
- cast_key_and_values(key)
6
- end
7
- end
8
-
9
- private
10
-
11
- def cast_key_and_values(key)
12
- fix_value(key, :default_value)
13
- key.lookup_values.each do |lv|
14
- fix_value(lv, :value)
15
- end
16
- end
17
-
18
- def safemode_box
19
- @safemode_box ||= Safemode::Box.new
20
- end
21
-
22
- def fix_value(obj, attribute)
23
- return if obj.omit && !obj.try(:merge_default)
24
- value = obj.send(attribute)
25
- return unless value.is_a? String
26
- return if value.contains_erb?
27
- fixed = safemode_box.eval(value)
28
- obj.update_column(attribute, fixed)
29
- rescue StandardError => e
30
- say "Failed to cast #{attribute} for #{obj.inspect}:"
31
- say "Value: #{value}", subitem: true
32
- say "Error: #{e.message}", subitem: true
33
- say 'Perhaps it is invalid? Casting skipped, manual action may be needed.', subitem: true
34
- end
35
- end