foreman_puppet 1.0.5 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) 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/hosts_controller_extensions.rb +0 -1
  7. data/app/controllers/concerns/foreman_puppet/extensions/parameters_hostgroup.rb +2 -8
  8. data/app/controllers/foreman_puppet/api/v2/environments_controller.rb +0 -1
  9. data/app/controllers/foreman_puppet/api/v2/hostgroup_classes_controller.rb +1 -1
  10. data/app/controllers/foreman_puppet/puppetclasses_controller.rb +1 -1
  11. data/app/helpers/foreman_puppet/environments_helper.rb +1 -1
  12. data/app/helpers/foreman_puppet/hosts_and_hostgroups_helper.rb +0 -5
  13. data/app/helpers/foreman_puppet/hosts_helper.rb +6 -10
  14. data/app/helpers/foreman_puppet/puppetclass_lookup_keys_helper.rb +1 -1
  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/services/foreman_puppet/puppet_class_importer.rb +0 -6
  20. data/app/views/foreman_puppet/api/v2/host_puppet_facets/host_list.json.rabl +3 -0
  21. data/app/views/foreman_puppet/api/v2/hostgroup_puppet_facets/base.json.rabl +2 -0
  22. data/app/views/foreman_puppet/api/v2/hostgroup_puppet_facets/hostgroup_list.json.rabl +3 -0
  23. data/app/views/foreman_puppet/config_groups/index.html.erb +1 -1
  24. data/config/api_routes.rb +1 -9
  25. data/config/initializers/api_reroute.rb +73 -5
  26. data/db/migrate/20101121140000_add_environment_to_template_combinations.foreman_puppet.rb +1 -1
  27. data/db/migrate/20200803113803_migrate_environment_to_puppet_facet.foreman_puppet.rb +2 -0
  28. data/db/migrate/20201125113903_migrate_puppetclasses_to_facets.foreman_puppet.rb +0 -8
  29. data/db/migrate/20210924103241_remove_katello_id_from_environments.foreman_puppet.rb +5 -0
  30. data/db/migrate/20211111125003_drop_puppetclasses_direct_references.foreman_puppet.rb +11 -0
  31. data/db/migrate/20220201205305_migrate_host_class_permission.foreman_puppet.rb +9 -0
  32. data/db/migrate/20220208135305_migrate_environment_ignore_type.foreman_puppet.rb +15 -0
  33. data/db/migrate_foreman/{20090722141107_create_environments.rb → 20090722141107_create_environments.foreman_puppet.rb} +3 -3
  34. data/db/migrate_foreman/20090802062223_create_puppetclasses.foreman_puppet.rb +29 -0
  35. data/db/migrate_foreman/20090905150132_create_hostgroups_puppetclasses.foreman_puppet.rb +14 -0
  36. data/db/migrate_foreman/20110412103238_remove_unused_fields_from_puppet_classes.foreman_puppet.rb +9 -0
  37. data/db/migrate_foreman/20110712070522_create_host_class.foreman_puppet.rb +11 -0
  38. data/db/migrate_foreman/20120824142048_add_some_indexes.foreman_puppet.rb +21 -0
  39. data/db/migrate_foreman/{20120905095532_create_environment_classes.rb → 20120905095532_create_environment_classes.foreman_puppet.rb} +2 -2
  40. data/db/migrate_foreman/20121018152459_create_hostgroup_classes.foreman_puppet.rb +11 -0
  41. data/db/migrate_foreman/{20140407161817_create_config_groups.rb → 20140407161817_create_config_groups.foreman_puppet.rb} +0 -0
  42. data/db/migrate_foreman/{20140407162007_create_config_group_classes.rb → 20140407162007_create_config_group_classes.foreman_puppet.rb} +0 -0
  43. data/db/migrate_foreman/{20140407162059_create_host_config_groups.rb → 20140407162059_create_host_config_groups.foreman_puppet.rb} +0 -0
  44. data/db/migrate_foreman/{20161205142618_delete_orphaned_smart_class_parameters.rb → 20161205142618_delete_orphaned_smart_class_parameters.foreman_puppet.rb} +1 -1
  45. data/db/migrate_foreman/{20170109115157_fix_lookup_key_auditable_type.rb → 20170109115157_fix_lookup_key_auditable_type.foreman_puppet.rb} +0 -0
  46. data/db/migrate_foreman/20180816134832_cast_lookup_key_values.foreman_puppet.rb +5 -0
  47. data/db/migrate_foreman/20180831115634_add_uniqueness_to_puppetclass_name.foreman_puppet.rb +24 -0
  48. data/db/migrate_foreman/{20181023112532_add_environment_puppetclass_id.rb → 20181023112532_add_environment_puppetclass_id.foreman_puppet.rb} +1 -1
  49. 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
  50. data/lib/foreman_puppet/engine.rb +4 -36
  51. data/lib/foreman_puppet/register.rb +51 -46
  52. data/lib/foreman_puppet/version.rb +1 -1
  53. data/lib/foreman_puppet.rb +1 -6
  54. data/locale/ca/LC_MESSAGES/foreman_puppet.mo +0 -0
  55. data/locale/ca/foreman_puppet.po +760 -0
  56. data/locale/cs_CZ/LC_MESSAGES/foreman_puppet.mo +0 -0
  57. data/locale/cs_CZ/foreman_puppet.po +823 -0
  58. data/locale/de/LC_MESSAGES/foreman_puppet.mo +0 -0
  59. data/locale/de/foreman_puppet.po +844 -0
  60. data/locale/en/LC_MESSAGES/foreman_puppet.mo +0 -0
  61. data/locale/en/foreman_puppet.po +119 -8
  62. data/locale/en_GB/LC_MESSAGES/foreman_puppet.mo +0 -0
  63. data/locale/en_GB/foreman_puppet.po +820 -0
  64. data/locale/es/LC_MESSAGES/foreman_puppet.mo +0 -0
  65. data/locale/es/foreman_puppet.po +827 -0
  66. data/locale/foreman_puppet.pot +376 -205
  67. data/locale/fr/LC_MESSAGES/foreman_puppet.mo +0 -0
  68. data/locale/fr/foreman_puppet.po +835 -0
  69. data/locale/gemspec.rb +1 -1
  70. data/locale/gl/LC_MESSAGES/foreman_puppet.mo +0 -0
  71. data/locale/gl/foreman_puppet.po +818 -0
  72. data/locale/it/LC_MESSAGES/foreman_puppet.mo +0 -0
  73. data/locale/it/foreman_puppet.po +822 -0
  74. data/locale/ja/LC_MESSAGES/foreman_puppet.mo +0 -0
  75. data/locale/ja/foreman_puppet.po +830 -0
  76. data/locale/ko/LC_MESSAGES/foreman_puppet.mo +0 -0
  77. data/locale/ko/foreman_puppet.po +819 -0
  78. data/locale/nl_NL/LC_MESSAGES/foreman_puppet.mo +0 -0
  79. data/locale/nl_NL/foreman_puppet.po +823 -0
  80. data/locale/pl/LC_MESSAGES/foreman_puppet.mo +0 -0
  81. data/locale/pl/foreman_puppet.po +822 -0
  82. data/locale/pt_BR/LC_MESSAGES/foreman_puppet.mo +0 -0
  83. data/locale/pt_BR/foreman_puppet.po +826 -0
  84. data/locale/ru/LC_MESSAGES/foreman_puppet.mo +0 -0
  85. data/locale/ru/foreman_puppet.po +827 -0
  86. data/locale/sv_SE/LC_MESSAGES/foreman_puppet.mo +0 -0
  87. data/locale/sv_SE/foreman_puppet.po +822 -0
  88. data/locale/zh_CN/LC_MESSAGES/foreman_puppet.mo +0 -0
  89. data/locale/zh_CN/foreman_puppet.po +831 -0
  90. data/locale/zh_TW/LC_MESSAGES/foreman_puppet.mo +0 -0
  91. data/locale/zh_TW/foreman_puppet.po +821 -0
  92. data/package.json +8 -11
  93. data/test/controllers/foreman_puppet/api/v2/environments_controller_test.rb +0 -231
  94. data/test/controllers/foreman_puppet/api/v2/smart_proxies_controller_test.rb +255 -0
  95. data/test/controllers/foreman_puppet/environments_controller_test.rb +2 -2
  96. data/test/controllers/foreman_puppet/hosts_controller_test.rb +0 -1
  97. data/test/factories/foreman_puppet_factories.rb +0 -2
  98. data/test/helpers/foreman_puppet/puppetclass_lookup_keys_helper_test.rb +34 -0
  99. data/test/integration/foreman_puppet/dashboard_js_test.rb +31 -0
  100. data/test/integration/foreman_puppet/host_js_test.rb +0 -1
  101. data/test/integration/foreman_puppet/puppetclass_js_test.rb +1 -1
  102. data/test/models/foreman_puppet/host_test.rb +26 -0
  103. data/test/models/foreman_puppet/user_test.rb +1 -5
  104. data/test/unit/foreman_puppet/puppet_class_importer_test.rb +1 -1
  105. metadata +69 -16
  106. data/db/migrate_foreman/20180816134832_cast_lookup_key_values.rb +0 -35
@@ -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.5
4
+ version: 2.0.3
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-11-15 00:00:00.000000000 Z
12
+ date: 2022-02-10 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,17 +185,28 @@ 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
188
+ - db/migrate/20210924103241_remove_katello_id_from_environments.foreman_puppet.rb
189
+ - db/migrate/20211111125003_drop_puppetclasses_direct_references.foreman_puppet.rb
186
190
  - db/migrate/20211112130803_cleanup_environment_from_core_tables.foreman_puppet.rb
187
- - db/migrate_foreman/20090722141107_create_environments.rb
188
- - db/migrate_foreman/20120905095532_create_environment_classes.rb
189
- - db/migrate_foreman/20140407161817_create_config_groups.rb
190
- - db/migrate_foreman/20140407162007_create_config_group_classes.rb
191
- - db/migrate_foreman/20140407162059_create_host_config_groups.rb
192
- - db/migrate_foreman/20161205142618_delete_orphaned_smart_class_parameters.rb
193
- - db/migrate_foreman/20170109115157_fix_lookup_key_auditable_type.rb
194
- - db/migrate_foreman/20180816134832_cast_lookup_key_values.rb
195
- - db/migrate_foreman/20181023112532_add_environment_puppetclass_id.rb
196
- - db/migrate_foreman/20181224174419_add_index_to_environment_class_by_lookup_key_and_puppetclass.rb
191
+ - db/migrate/20220201205305_migrate_host_class_permission.foreman_puppet.rb
192
+ - db/migrate/20220208135305_migrate_environment_ignore_type.foreman_puppet.rb
193
+ - db/migrate_foreman/20090722141107_create_environments.foreman_puppet.rb
194
+ - db/migrate_foreman/20090802062223_create_puppetclasses.foreman_puppet.rb
195
+ - db/migrate_foreman/20090905150132_create_hostgroups_puppetclasses.foreman_puppet.rb
196
+ - db/migrate_foreman/20110412103238_remove_unused_fields_from_puppet_classes.foreman_puppet.rb
197
+ - db/migrate_foreman/20110712070522_create_host_class.foreman_puppet.rb
198
+ - db/migrate_foreman/20120824142048_add_some_indexes.foreman_puppet.rb
199
+ - db/migrate_foreman/20120905095532_create_environment_classes.foreman_puppet.rb
200
+ - db/migrate_foreman/20121018152459_create_hostgroup_classes.foreman_puppet.rb
201
+ - db/migrate_foreman/20140407161817_create_config_groups.foreman_puppet.rb
202
+ - db/migrate_foreman/20140407162007_create_config_group_classes.foreman_puppet.rb
203
+ - db/migrate_foreman/20140407162059_create_host_config_groups.foreman_puppet.rb
204
+ - db/migrate_foreman/20161205142618_delete_orphaned_smart_class_parameters.foreman_puppet.rb
205
+ - db/migrate_foreman/20170109115157_fix_lookup_key_auditable_type.foreman_puppet.rb
206
+ - db/migrate_foreman/20180816134832_cast_lookup_key_values.foreman_puppet.rb
207
+ - db/migrate_foreman/20180831115634_add_uniqueness_to_puppetclass_name.foreman_puppet.rb
208
+ - db/migrate_foreman/20181023112532_add_environment_puppetclass_id.foreman_puppet.rb
209
+ - db/migrate_foreman/20181224174419_add_index_to_environment_class_by_lookup_key_and_puppetclass.foreman_puppet.rb
197
210
  - db/seeds.d/111_puppet_proxy_feature.rb
198
211
  - lib/foreman_puppet.rb
199
212
  - lib/foreman_puppet/engine.rb
@@ -202,16 +215,50 @@ files:
202
215
  - lib/tasks/foreman_puppet_tasks.rake
203
216
  - locale/Makefile
204
217
  - locale/action_names.rb
218
+ - locale/ca/LC_MESSAGES/foreman_puppet.mo
219
+ - locale/ca/foreman_puppet.po
220
+ - locale/cs_CZ/LC_MESSAGES/foreman_puppet.mo
205
221
  - locale/cs_CZ/foreman_puppet.edit.po
222
+ - locale/cs_CZ/foreman_puppet.po
206
223
  - locale/cs_CZ/foreman_puppet.po.time_stamp
224
+ - locale/de/LC_MESSAGES/foreman_puppet.mo
225
+ - locale/de/foreman_puppet.po
207
226
  - locale/en/LC_MESSAGES/foreman_puppet.mo
208
227
  - locale/en/foreman_puppet.edit.po
209
228
  - locale/en/foreman_puppet.po
210
229
  - locale/en/foreman_puppet.po.time_stamp
211
230
  - locale/en/foreman_puppet.pox
231
+ - locale/en_GB/LC_MESSAGES/foreman_puppet.mo
232
+ - locale/en_GB/foreman_puppet.po
233
+ - locale/es/LC_MESSAGES/foreman_puppet.mo
234
+ - locale/es/foreman_puppet.po
212
235
  - locale/foreman_puppet.pot
236
+ - locale/fr/LC_MESSAGES/foreman_puppet.mo
237
+ - locale/fr/foreman_puppet.po
213
238
  - locale/gemspec.rb
239
+ - locale/gl/LC_MESSAGES/foreman_puppet.mo
240
+ - locale/gl/foreman_puppet.po
241
+ - locale/it/LC_MESSAGES/foreman_puppet.mo
242
+ - locale/it/foreman_puppet.po
243
+ - locale/ja/LC_MESSAGES/foreman_puppet.mo
244
+ - locale/ja/foreman_puppet.po
245
+ - locale/ko/LC_MESSAGES/foreman_puppet.mo
246
+ - locale/ko/foreman_puppet.po
214
247
  - locale/messages.mo
248
+ - locale/nl_NL/LC_MESSAGES/foreman_puppet.mo
249
+ - locale/nl_NL/foreman_puppet.po
250
+ - locale/pl/LC_MESSAGES/foreman_puppet.mo
251
+ - locale/pl/foreman_puppet.po
252
+ - locale/pt_BR/LC_MESSAGES/foreman_puppet.mo
253
+ - locale/pt_BR/foreman_puppet.po
254
+ - locale/ru/LC_MESSAGES/foreman_puppet.mo
255
+ - locale/ru/foreman_puppet.po
256
+ - locale/sv_SE/LC_MESSAGES/foreman_puppet.mo
257
+ - locale/sv_SE/foreman_puppet.po
258
+ - locale/zh_CN/LC_MESSAGES/foreman_puppet.mo
259
+ - locale/zh_CN/foreman_puppet.po
260
+ - locale/zh_TW/LC_MESSAGES/foreman_puppet.mo
261
+ - locale/zh_TW/foreman_puppet.po
215
262
  - package.json
216
263
  - test/controllers/foreman_puppet/api/v2/config_groups_controller_test.rb
217
264
  - test/controllers/foreman_puppet/api/v2/environments_controller_test.rb
@@ -224,6 +271,7 @@ files:
224
271
  - test/controllers/foreman_puppet/api/v2/provisioning_templates_controller_test.rb
225
272
  - test/controllers/foreman_puppet/api/v2/puppetclasses_controller_test.rb
226
273
  - test/controllers/foreman_puppet/api/v2/smart_class_parameters_controller_test.rb
274
+ - test/controllers/foreman_puppet/api/v2/smart_proxies_controller_test.rb
227
275
  - test/controllers/foreman_puppet/api/v2/template_combinations_controller_test.rb
228
276
  - test/controllers/foreman_puppet/config_groups_controller_test.rb
229
277
  - test/controllers/foreman_puppet/environments_controller_test.rb
@@ -246,7 +294,9 @@ files:
246
294
  - test/graphql/queries/puppetclass_query_test.rb
247
295
  - test/graphql/queries/puppetclasses_query_test.rb
248
296
  - test/helpers/foreman_puppet/hosts_and_hostgroups_helper_test.rb
297
+ - test/helpers/foreman_puppet/puppetclass_lookup_keys_helper_test.rb
249
298
  - test/helpers/foreman_puppet/puppetclasses_helper_test.rb
299
+ - test/integration/foreman_puppet/dashboard_js_test.rb
250
300
  - test/integration/foreman_puppet/environment_js_test.rb
251
301
  - test/integration/foreman_puppet/host_js_test.rb
252
302
  - test/integration/foreman_puppet/hostgroup_js_test.rb
@@ -316,10 +366,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
316
366
  - !ruby/object:Gem::Version
317
367
  version: '0'
318
368
  requirements: []
319
- rubygems_version: 3.1.6
369
+ rubygems_version: 3.3.4
320
370
  signing_key:
321
371
  specification_version: 4
322
- summary: Adds puppet ENC features
372
+ summary: Add Puppet features to Foreman
323
373
  test_files:
324
374
  - test/services/foreman_puppet/host_info_providers/config_groups_info_test.rb
325
375
  - test/services/foreman_puppet/host_info_providers/puppet_info_test.rb
@@ -329,6 +379,7 @@ test_files:
329
379
  - test/integration/foreman_puppet/puppetclass_js_test.rb
330
380
  - test/integration/foreman_puppet/hostgroup_js_test.rb
331
381
  - test/integration/foreman_puppet/environment_js_test.rb
382
+ - test/integration/foreman_puppet/dashboard_js_test.rb
332
383
  - test/integration/foreman_puppet/host_js_test.rb
333
384
  - test/graphql/mutations/hosts/create_mutation_test.rb
334
385
  - test/graphql/queries/puppetclasses_query_test.rb
@@ -339,6 +390,7 @@ test_files:
339
390
  - test/graphql/queries/environment_query_test.rb
340
391
  - test/graphql/queries/hostgroup_puppet_query_test.rb
341
392
  - test/graphql/queries/environments_query_test.rb
393
+ - test/helpers/foreman_puppet/puppetclass_lookup_keys_helper_test.rb
342
394
  - test/helpers/foreman_puppet/puppetclasses_helper_test.rb
343
395
  - test/helpers/foreman_puppet/hosts_and_hostgroups_helper_test.rb
344
396
  - test/models/foreman_puppet/config_group_class_test.rb
@@ -379,6 +431,7 @@ test_files:
379
431
  - test/controllers/foreman_puppet/api/v2/lookups_common_controller_test.rb
380
432
  - test/controllers/foreman_puppet/api/v2/host_classes_controller_test.rb
381
433
  - test/controllers/foreman_puppet/api/v2/provisioning_templates_controller_test.rb
434
+ - test/controllers/foreman_puppet/api/v2/smart_proxies_controller_test.rb
382
435
  - test/controllers/foreman_puppet/api/v2/puppetclasses_controller_test.rb
383
436
  - test/controllers/foreman_puppet/api/v2/hosts_controller_test.rb
384
437
  - 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