hammer_cli_foreman 2.5.1 → 3.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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes.md +10 -1
  3. data/lib/hammer_cli_foreman.rb +0 -21
  4. data/lib/hammer_cli_foreman/architecture.rb +5 -5
  5. data/lib/hammer_cli_foreman/associating_commands.rb +0 -24
  6. data/lib/hammer_cli_foreman/bookmark.rb +5 -5
  7. data/lib/hammer_cli_foreman/combination.rb +3 -13
  8. data/lib/hammer_cli_foreman/command_extensions.rb +0 -2
  9. data/lib/hammer_cli_foreman/commands.rb +2 -9
  10. data/lib/hammer_cli_foreman/compute_profile.rb +5 -5
  11. data/lib/hammer_cli_foreman/host.rb +0 -35
  12. data/lib/hammer_cli_foreman/hostgroup.rb +2 -53
  13. data/lib/hammer_cli_foreman/hosts/common_update_options.rb +1 -23
  14. data/lib/hammer_cli_foreman/id_resolver.rb +0 -61
  15. data/lib/hammer_cli_foreman/location.rb +0 -6
  16. data/lib/hammer_cli_foreman/mail_notification.rb +2 -2
  17. data/lib/hammer_cli_foreman/model.rb +5 -5
  18. data/lib/hammer_cli_foreman/operating_system.rb +10 -10
  19. data/lib/hammer_cli_foreman/option_sources.rb +0 -1
  20. data/lib/hammer_cli_foreman/option_sources/id_params.rb +27 -10
  21. data/lib/hammer_cli_foreman/option_sources/ids_params.rb +25 -6
  22. data/lib/hammer_cli_foreman/organization.rb +0 -6
  23. data/lib/hammer_cli_foreman/references.rb +0 -16
  24. data/lib/hammer_cli_foreman/settings.rb +3 -3
  25. data/lib/hammer_cli_foreman/smart_proxy.rb +0 -52
  26. data/lib/hammer_cli_foreman/usergroup.rb +5 -5
  27. data/lib/hammer_cli_foreman/version.rb +1 -1
  28. data/lib/minitest/coverage_reporter.rb +1 -1
  29. data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  30. data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  31. data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  32. data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  33. data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  34. data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  35. data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  36. data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  37. data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  38. data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  39. data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  40. data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  41. data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  42. data/test/functional/architecture_test.rb +6 -4
  43. data/test/functional/bookmark_test.rb +3 -1
  44. data/test/functional/compute_profile_test.rb +3 -1
  45. data/test/functional/host_test.rb +0 -1
  46. data/test/functional/hostgroup/create_test.rb +0 -117
  47. data/test/functional/hostgroup/update_test.rb +0 -79
  48. data/test/functional/location_test.rb +0 -3
  49. data/test/functional/mail_notification_test.rb +3 -1
  50. data/test/functional/model_test.rb +3 -1
  51. data/test/functional/operating_system_test.rb +3 -1
  52. data/test/functional/settings_test.rb +4 -4
  53. data/test/functional/template_test.rb +4 -37
  54. data/test/functional/usergroup_test.rb +3 -1
  55. data/test/unit/apipie_resource_mock.rb +1 -39
  56. data/test/unit/architecture_test.rb +10 -10
  57. data/test/unit/bookmark_test.rb +10 -14
  58. data/test/unit/compute_profile_test.rb +10 -10
  59. data/test/unit/helpers/command.rb +0 -8
  60. data/test/unit/host_test.rb +14 -61
  61. data/test/unit/hostgroup_test.rb +7 -26
  62. data/test/unit/id_resolver_test.rb +0 -28
  63. data/test/unit/mail_notification_test.rb +4 -4
  64. data/test/unit/model_test.rb +47 -47
  65. data/test/unit/operating_system_test.rb +10 -16
  66. data/test/unit/option_sources/id_params_test.rb +9 -0
  67. data/test/unit/option_sources/ids_params_test.rb +9 -0
  68. data/test/unit/settings_test.rb +4 -4
  69. data/test/unit/smart_proxy_test.rb +0 -12
  70. data/test/unit/usergroup_test.rb +10 -10
  71. metadata +64 -85
  72. data/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb +0 -29
  73. data/lib/hammer_cli_foreman/command_extensions/puppet_environments.rb +0 -29
  74. data/lib/hammer_cli_foreman/config_group.rb +0 -45
  75. data/lib/hammer_cli_foreman/option_sources/puppet_environment_params.rb +0 -59
  76. data/lib/hammer_cli_foreman/puppet_class.rb +0 -61
  77. data/lib/hammer_cli_foreman/puppet_environment.rb +0 -65
  78. data/lib/hammer_cli_foreman/smart_class_parameter.rb +0 -189
  79. data/test/functional/config_group_test.rb +0 -50
  80. data/test/functional/proxy_test.rb +0 -86
  81. data/test/functional/smart_class_parameter_test.rb +0 -97
  82. data/test/unit/config_group_test.rb +0 -82
  83. data/test/unit/puppet_class_test.rb +0 -72
  84. data/test/unit/puppet_environment_test.rb +0 -114
  85. data/test/unit/smart_class_parameter_test.rb +0 -113
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_foreman
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomáš Strachota
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-06-08 00:00:00.000000000 Z
12
+ date: 2021-08-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hammer_cli
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 2.5.0
20
+ version: 3.0.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 2.5.0
27
+ version: 3.0.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: apipie-bindings
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -81,13 +81,13 @@ executables: []
81
81
  extensions: []
82
82
  extra_rdoc_files:
83
83
  - doc/configuration.md
84
- - doc/developer_docs.md
85
- - doc/host_create.md
86
84
  - doc/name_id_resolution.md
87
85
  - doc/option_builder.md
86
+ - doc/using_hammer_cli_foreman_command.md
87
+ - doc/developer_docs.md
88
+ - doc/host_create.md
88
89
  - doc/plugin.md
89
90
  - doc/testing.md
90
- - doc/using_hammer_cli_foreman_command.md
91
91
  - doc/release_notes.md
92
92
  - README.md
93
93
  files:
@@ -130,8 +130,6 @@ files:
130
130
  - lib/hammer_cli_foreman/command_extensions/hosts/help/interfaces.rb
131
131
  - lib/hammer_cli_foreman/command_extensions/option_sources.rb
132
132
  - lib/hammer_cli_foreman/command_extensions/ping.rb
133
- - lib/hammer_cli_foreman/command_extensions/puppet_environment.rb
134
- - lib/hammer_cli_foreman/command_extensions/puppet_environments.rb
135
133
  - lib/hammer_cli_foreman/command_extensions/status.rb
136
134
  - lib/hammer_cli_foreman/command_extensions/subnet.rb
137
135
  - lib/hammer_cli_foreman/command_extensions/update_common.rb
@@ -151,7 +149,6 @@ files:
151
149
  - lib/hammer_cli_foreman/compute_resource/register_compute_resources.rb
152
150
  - lib/hammer_cli_foreman/compute_resource/utils.rb
153
151
  - lib/hammer_cli_foreman/compute_resource/vmware.rb
154
- - lib/hammer_cli_foreman/config_group.rb
155
152
  - lib/hammer_cli_foreman/config_report.rb
156
153
  - lib/hammer_cli_foreman/defaults.rb
157
154
  - lib/hammer_cli_foreman/dependency_resolver.rb
@@ -182,7 +179,6 @@ files:
182
179
  - lib/hammer_cli_foreman/option_sources/id_params.rb
183
180
  - lib/hammer_cli_foreman/option_sources/ids_params.rb
184
181
  - lib/hammer_cli_foreman/option_sources/new_params.rb
185
- - lib/hammer_cli_foreman/option_sources/puppet_environment_params.rb
186
182
  - lib/hammer_cli_foreman/option_sources/referenced_resource_id_params.rb
187
183
  - lib/hammer_cli_foreman/option_sources/self_param.rb
188
184
  - lib/hammer_cli_foreman/option_sources/user_params.rb
@@ -195,8 +191,6 @@ files:
195
191
  - lib/hammer_cli_foreman/partition_table.rb
196
192
  - lib/hammer_cli_foreman/personal_access_token.rb
197
193
  - lib/hammer_cli_foreman/ping.rb
198
- - lib/hammer_cli_foreman/puppet_class.rb
199
- - lib/hammer_cli_foreman/puppet_environment.rb
200
194
  - lib/hammer_cli_foreman/realm.rb
201
195
  - lib/hammer_cli_foreman/references.rb
202
196
  - lib/hammer_cli_foreman/registration.rb
@@ -205,7 +199,6 @@ files:
205
199
  - lib/hammer_cli_foreman/role.rb
206
200
  - lib/hammer_cli_foreman/sessions.rb
207
201
  - lib/hammer_cli_foreman/settings.rb
208
- - lib/hammer_cli_foreman/smart_class_parameter.rb
209
202
  - lib/hammer_cli_foreman/smart_proxy.rb
210
203
  - lib/hammer_cli_foreman/ssh_keys.rb
211
204
  - lib/hammer_cli_foreman/status.rb
@@ -259,7 +252,6 @@ files:
259
252
  - test/functional/compute_attribute_test.rb
260
253
  - test/functional/compute_profile_test.rb
261
254
  - test/functional/compute_resource_test.rb
262
- - test/functional/config_group_test.rb
263
255
  - test/functional/filter_test.rb
264
256
  - test/functional/host_test.rb
265
257
  - test/functional/hostgroup/create_test.rb
@@ -273,13 +265,11 @@ files:
273
265
  - test/functional/organization_test.rb
274
266
  - test/functional/personal_access_token_test.rb
275
267
  - test/functional/ping_test.rb
276
- - test/functional/proxy_test.rb
277
268
  - test/functional/realm_test.rb
278
269
  - test/functional/registration_test.rb
279
270
  - test/functional/report_template_test.rb
280
271
  - test/functional/role_test.rb
281
272
  - test/functional/settings_test.rb
282
- - test/functional/smart_class_parameter_test.rb
283
273
  - test/functional/ssh_keys_test.rb
284
274
  - test/functional/status_test.rb
285
275
  - test/functional/subnet/create_test.rb
@@ -307,7 +297,6 @@ files:
307
297
  - test/unit/common_parameter_test.rb
308
298
  - test/unit/compute_profile_test.rb
309
299
  - test/unit/compute_resource_test.rb
310
- - test/unit/config_group_test.rb
311
300
  - test/unit/config_report_test.rb
312
301
  - test/unit/data/test_api.json
313
302
  - test/unit/defaults_test.rb
@@ -337,13 +326,10 @@ files:
337
326
  - test/unit/output/formatters_test.rb
338
327
  - test/unit/param_filters_test.rb
339
328
  - test/unit/partition_table_test.rb
340
- - test/unit/puppet_class_test.rb
341
- - test/unit/puppet_environment_test.rb
342
329
  - test/unit/realm_test.rb
343
330
  - test/unit/role_test.rb
344
331
  - test/unit/sessions_test.rb
345
332
  - test/unit/settings_test.rb
346
- - test/unit/smart_class_parameter_test.rb
347
333
  - test/unit/smart_proxy_test.rb
348
334
  - test/unit/subnet_test.rb
349
335
  - test/unit/template_test.rb
@@ -392,104 +378,97 @@ test_files:
392
378
  - test/data/2.4/foreman_api.json
393
379
  - test/data/2.5/foreman_api.json
394
380
  - test/data/README.md
395
- - test/functional/associating_commands_test.rb
396
- - test/functional/audit_test.rb
397
381
  - test/functional/auth_source_test.rb
398
382
  - test/functional/commands/list_test.rb
399
- - test/functional/compute_attribute_test.rb
400
- - test/functional/compute_resource_test.rb
401
- - test/functional/config_group_test.rb
402
- - test/functional/filter_test.rb
383
+ - test/functional/compute_profile_test.rb
403
384
  - test/functional/hostgroup/create_test.rb
404
385
  - test/functional/hostgroup/update_test.rb
405
- - test/functional/mail_notification_test.rb
406
- - test/functional/model_test.rb
407
- - test/functional/operating_system_test.rb
408
- - test/functional/organization_test.rb
409
- - test/functional/personal_access_token_test.rb
410
- - test/functional/ping_test.rb
411
- - test/functional/proxy_test.rb
412
- - test/functional/registration_test.rb
413
- - test/functional/role_test.rb
414
- - test/functional/settings_test.rb
415
- - test/functional/smart_class_parameter_test.rb
386
+ - test/functional/template_test.rb
416
387
  - test/functional/ssh_keys_test.rb
417
- - test/functional/status_test.rb
418
- - test/functional/subnet/create_test.rb
419
388
  - test/functional/subnet/update_test.rb
389
+ - test/functional/subnet/create_test.rb
420
390
  - test/functional/test_helper.rb
391
+ - test/functional/filter_test.rb
392
+ - test/functional/http_proxy_test.rb
393
+ - test/functional/media_test.rb
394
+ - test/functional/registration_test.rb
395
+ - test/functional/bookmark_test.rb
396
+ - test/functional/mail_notification_test.rb
397
+ - test/functional/settings_test.rb
421
398
  - test/functional/user_mail_notification_test.rb
422
- - test/functional/usergroup_test.rb
399
+ - test/functional/compute_resource_test.rb
400
+ - test/functional/organization_test.rb
401
+ - test/functional/report_template_test.rb
402
+ - test/functional/user_test.rb
423
403
  - test/functional/virtual_machine_test.rb
424
404
  - test/functional/architecture_test.rb
425
- - test/functional/bookmark_test.rb
426
- - test/functional/compute_profile_test.rb
405
+ - test/functional/model_test.rb
406
+ - test/functional/compute_attribute_test.rb
427
407
  - test/functional/host_test.rb
428
- - test/functional/http_proxy_test.rb
429
- - test/functional/location_test.rb
430
- - test/functional/media_test.rb
408
+ - test/functional/associating_commands_test.rb
409
+ - test/functional/audit_test.rb
410
+ - test/functional/ping_test.rb
431
411
  - test/functional/realm_test.rb
432
- - test/functional/report_template_test.rb
433
- - test/functional/user_test.rb
434
- - test/functional/template_test.rb
435
- - test/test_helper.rb
412
+ - test/functional/role_test.rb
413
+ - test/functional/status_test.rb
414
+ - test/functional/operating_system_test.rb
415
+ - test/functional/usergroup_test.rb
416
+ - test/functional/personal_access_token_test.rb
417
+ - test/functional/location_test.rb
418
+ - test/unit/api/void_auth_test.rb
436
419
  - test/unit/api/interactive_basic_auth_test.rb
437
420
  - test/unit/api/oauth/oauth_authentication_code_grant_test.rb
438
421
  - test/unit/api/oauth/oauth_password_grant_test.rb
439
422
  - test/unit/api/session_authenticator_wrapper_test.rb
440
- - test/unit/api/void_auth_test.rb
441
- - test/unit/api_test.rb
442
- - test/unit/apipie_resource_mock.rb
443
- - test/unit/architecture_test.rb
444
- - test/unit/audit_test.rb
445
- - test/unit/auth_source_external.rb
423
+ - test/unit/test_output_adapter.rb
424
+ - test/unit/host_test.rb
446
425
  - test/unit/auth_source_ldap_test.rb
447
- - test/unit/bookmark_test.rb
448
- - test/unit/commands_test.rb
449
- - test/unit/common_parameter_test.rb
450
- - test/unit/compute_profile_test.rb
451
- - test/unit/compute_resource_test.rb
452
- - test/unit/config_group_test.rb
453
426
  - test/unit/config_report_test.rb
427
+ - test/unit/compute_resource_test.rb
454
428
  - test/unit/data/test_api.json
455
429
  - test/unit/defaults_test.rb
456
- - test/unit/dependency_resolver_test.rb
457
- - test/unit/domain_test.rb
458
- - test/unit/exception_handler_test.rb
430
+ - test/unit/architecture_test.rb
459
431
  - test/unit/external_usergroup_test.rb
460
432
  - test/unit/fact_test.rb
461
- - test/unit/filter_test.rb
462
- - test/unit/helpers/command.rb
463
433
  - test/unit/helpers/fake_searchables.rb
464
434
  - test/unit/helpers/resource_disabled.rb
465
- - test/unit/id_resolver_test.rb
435
+ - test/unit/helpers/command.rb
466
436
  - test/unit/image_test.rb
467
437
  - test/unit/location_test.rb
468
- - test/unit/mail_notification_test.rb
469
- - test/unit/media_test.rb
470
438
  - test/unit/messages_test.rb
471
- - test/unit/model_test.rb
472
- - test/unit/operating_system_test.rb
473
- - test/unit/option_builders_test.rb
439
+ - test/unit/bookmark_test.rb
474
440
  - test/unit/option_sources/id_params_test.rb
475
441
  - test/unit/option_sources/ids_params_test.rb
476
442
  - test/unit/organization_test.rb
477
443
  - test/unit/output/formatters_test.rb
478
- - test/unit/param_filters_test.rb
479
- - test/unit/partition_table_test.rb
480
- - test/unit/puppet_class_test.rb
444
+ - test/unit/common_parameter_test.rb
481
445
  - test/unit/realm_test.rb
482
- - test/unit/role_test.rb
483
- - test/unit/sessions_test.rb
484
- - test/unit/settings_test.rb
446
+ - test/unit/usergroup_test.rb
447
+ - test/unit/option_builders_test.rb
485
448
  - test/unit/subnet_test.rb
486
- - test/unit/template_test.rb
487
449
  - test/unit/test_helper.rb
488
- - test/unit/test_output_adapter.rb
489
450
  - test/unit/user_test.rb
490
- - test/unit/usergroup_test.rb
491
- - test/unit/host_test.rb
451
+ - test/unit/param_filters_test.rb
452
+ - test/unit/partition_table_test.rb
453
+ - test/unit/role_test.rb
492
454
  - test/unit/hostgroup_test.rb
493
- - test/unit/puppet_environment_test.rb
494
- - test/unit/smart_class_parameter_test.rb
455
+ - test/unit/mail_notification_test.rb
456
+ - test/unit/model_test.rb
457
+ - test/unit/operating_system_test.rb
458
+ - test/unit/audit_test.rb
459
+ - test/unit/auth_source_external.rb
460
+ - test/unit/dependency_resolver_test.rb
461
+ - test/unit/exception_handler_test.rb
462
+ - test/unit/filter_test.rb
463
+ - test/unit/media_test.rb
464
+ - test/unit/sessions_test.rb
465
+ - test/unit/apipie_resource_mock.rb
466
+ - test/unit/api_test.rb
495
467
  - test/unit/smart_proxy_test.rb
468
+ - test/unit/settings_test.rb
469
+ - test/unit/commands_test.rb
470
+ - test/unit/id_resolver_test.rb
471
+ - test/unit/template_test.rb
472
+ - test/unit/compute_profile_test.rb
473
+ - test/unit/domain_test.rb
474
+ - test/test_helper.rb
@@ -1,29 +0,0 @@
1
- module HammerCLIForeman
2
- module CommandExtensions
3
- class PuppetEnvironment < HammerCLI::CommandExtensions
4
- # Remove when support of --environment options is ended.
5
- option_family(
6
- aliased_resource: 'environment',
7
- description: _('Puppet environment'),
8
- deprecation: _("Use %s instead") % '--puppet-environment[-id]',
9
- deprecated: { '--environment' => _("Use %s instead") % '--puppet-environment[-id]',
10
- '--environment-id' => _("Use %s instead") % '--puppet-environment[-id]'}
11
- ) do
12
- parent '--environment-id', 'ENVIRONMENT_ID', _(''),
13
- format: HammerCLI::Options::Normalizers::Number.new,
14
- attribute_name: :option_environment_id
15
- child '--environment', 'ENVIRONMENT_NAME', _('Environment name'),
16
- attribute_name: :option_environment_name
17
- end
18
-
19
- option_sources do |sources, command|
20
- sources.find_by_name('IdResolution').insert_relative(
21
- :after,
22
- 'IdParams',
23
- HammerCLIForeman::OptionSources::PuppetEnvironmentParams.new(command)
24
- )
25
- sources
26
- end
27
- end
28
- end
29
- end
@@ -1,29 +0,0 @@
1
- module HammerCLIForeman
2
- module CommandExtensions
3
- class PuppetEnvironments < HammerCLI::CommandExtensions
4
- # Remove when support of --environments options is ended.
5
- option_family(
6
- aliased_resource: 'environment',
7
- description: _('Puppet environments'),
8
- deprecation: _("Use %s instead") % '--puppet-environment[s|-ids]',
9
- deprecated: { '--environments' => _("Use %s instead") % '--puppet-environment[s|-ids]',
10
- '--environment-ids' => _("Use %s instead") % '--puppet-environment[s|-ids]' }
11
- ) do
12
- parent '--environment-ids', 'ENVIRONMENT_IDS', _('Environment IDs'),
13
- format: HammerCLI::Options::Normalizers::List.new,
14
- attribute_name: :option_environment_ids
15
- child '--environments', 'ENVIRONMENT_NAMES', _(''),
16
- attribute_name: :option_environment_names
17
- end
18
-
19
- option_sources do |sources, command|
20
- sources.find_by_name('IdResolution').insert_relative(
21
- :after,
22
- 'IdsParams',
23
- HammerCLIForeman::OptionSources::PuppetEnvironmentParams.new(command)
24
- )
25
- sources
26
- end
27
- end
28
- end
29
- end
@@ -1,45 +0,0 @@
1
- module HammerCLIForeman
2
- class ConfigGroup < HammerCLIForeman::Command
3
- resource :config_groups
4
-
5
- class ListCommand < HammerCLIForeman::ListCommand
6
- output do
7
- field :id, _("ID")
8
- field :name, _("Name")
9
- end
10
-
11
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
12
- end
13
-
14
- class InfoCommand < HammerCLIForeman::InfoCommand
15
- output ListCommand.output_definition do
16
- HammerCLIForeman::References.puppetclasses(self)
17
- end
18
-
19
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
20
- end
21
-
22
- class CreateCommand < HammerCLIForeman::CreateCommand
23
- success_message _("Config group created.")
24
- failure_message _("Could not create the config group")
25
-
26
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
27
- end
28
-
29
- class UpdateCommand < HammerCLIForeman::UpdateCommand
30
- success_message _("Config group updated.")
31
- failure_message _("Could not update the config group")
32
-
33
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
34
- end
35
-
36
- class DeleteCommand < HammerCLIForeman::DeleteCommand
37
- success_message _("Config group has been deleted.")
38
- failure_message _("Could not delete the config group")
39
-
40
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
41
- end
42
-
43
- autoload_subcommands
44
- end
45
- end
@@ -1,59 +0,0 @@
1
- module HammerCLIForeman
2
- module OptionSources
3
- class PuppetEnvironmentParams < HammerCLI::Options::Sources::Base
4
- def initialize(command)
5
- @command = command
6
- end
7
-
8
- def get_options(_defined_options, result)
9
- if result['option_environment_id'].nil? &&
10
- (@command.respond_to?(:option_environment_id) ||
11
- @command.respond_to?(:option_environment_name))
12
- put_puppet_environment_id(result)
13
- end
14
- if result['option_environment_ids'].nil? &&
15
- (@command.respond_to?(:option_environment_ids) ||
16
- @command.respond_to?(:option_environment_names))
17
- put_puppet_environment_ids(result)
18
- end
19
- result
20
- end
21
-
22
- private
23
-
24
- def put_puppet_environment_id(result)
25
- if result['option_environment_name'].nil?
26
- if @command.option_environment_id
27
- result['option_environment_id'] = @command.option_environment_id
28
- elsif @command.option_environment_name
29
- result['option_environment_name'] = @command.option_environment_name
30
- result['option_environment_id'] = @command.resolver.puppet_environment_id(
31
- @command.resolver.scoped_options('environment', result, :single)
32
- )
33
- end
34
- else
35
- result['option_environment_id'] = @command.resolver.puppet_environment_id(
36
- @command.resolver.scoped_options('environment', result, :single)
37
- )
38
- end
39
- end
40
-
41
- def put_puppet_environment_ids(result)
42
- if result['option_environment_names'].nil?
43
- if @command.option_environment_ids
44
- result['option_environment_ids'] = @command.option_environment_ids
45
- elsif @command.option_environment_names
46
- result['option_environment_names'] = @command.option_environment_names
47
- result['option_environment_ids'] = @command.resolver.puppet_environment_ids(
48
- @command.resolver.scoped_options('environment', result, :multi)
49
- )
50
- end
51
- else
52
- result['option_environment_ids'] = @command.resolver.puppet_environment_ids(
53
- @command.resolver.scoped_options('environment', result, :multi)
54
- )
55
- end
56
- end
57
- end
58
- end
59
- end