hammer_cli_foreman 2.5.2 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes.md +10 -4
  3. data/lib/hammer_cli_foreman/architecture.rb +5 -5
  4. data/lib/hammer_cli_foreman/associating_commands.rb +0 -24
  5. data/lib/hammer_cli_foreman/bookmark.rb +5 -5
  6. data/lib/hammer_cli_foreman/combination.rb +3 -13
  7. data/lib/hammer_cli_foreman/command_extensions.rb +0 -2
  8. data/lib/hammer_cli_foreman/commands.rb +2 -9
  9. data/lib/hammer_cli_foreman/compute_profile.rb +5 -5
  10. data/lib/hammer_cli_foreman/host.rb +0 -35
  11. data/lib/hammer_cli_foreman/hostgroup.rb +2 -53
  12. data/lib/hammer_cli_foreman/hosts/common_update_options.rb +1 -23
  13. data/lib/hammer_cli_foreman/id_resolver.rb +0 -61
  14. data/lib/hammer_cli_foreman/location.rb +0 -6
  15. data/lib/hammer_cli_foreman/mail_notification.rb +2 -2
  16. data/lib/hammer_cli_foreman/model.rb +5 -5
  17. data/lib/hammer_cli_foreman/operating_system.rb +10 -10
  18. data/lib/hammer_cli_foreman/option_sources/id_params.rb +27 -10
  19. data/lib/hammer_cli_foreman/option_sources/ids_params.rb +25 -6
  20. data/lib/hammer_cli_foreman/option_sources.rb +0 -1
  21. data/lib/hammer_cli_foreman/organization.rb +0 -6
  22. data/lib/hammer_cli_foreman/references.rb +0 -16
  23. data/lib/hammer_cli_foreman/settings.rb +3 -3
  24. data/lib/hammer_cli_foreman/smart_proxy.rb +0 -52
  25. data/lib/hammer_cli_foreman/usergroup.rb +5 -5
  26. data/lib/hammer_cli_foreman/version.rb +1 -1
  27. data/lib/hammer_cli_foreman.rb +0 -21
  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 +27 -48
  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.2
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: 2022-02-01 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
@@ -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
@@ -394,15 +380,9 @@ test_files:
394
380
  - test/data/README.md
395
381
  - test/functional/auth_source_test.rb
396
382
  - test/functional/commands/list_test.rb
383
+ - test/functional/compute_profile_test.rb
397
384
  - test/functional/hostgroup/create_test.rb
398
385
  - test/functional/hostgroup/update_test.rb
399
- - test/functional/location_test.rb
400
- - test/functional/mail_notification_test.rb
401
- - test/functional/model_test.rb
402
- - test/functional/operating_system_test.rb
403
- - test/functional/personal_access_token_test.rb
404
- - test/functional/proxy_test.rb
405
- - test/functional/settings_test.rb
406
386
  - test/functional/template_test.rb
407
387
  - test/functional/ssh_keys_test.rb
408
388
  - test/functional/subnet/update_test.rb
@@ -412,16 +392,18 @@ test_files:
412
392
  - test/functional/http_proxy_test.rb
413
393
  - test/functional/media_test.rb
414
394
  - test/functional/registration_test.rb
415
- - test/functional/architecture_test.rb
416
- - test/functional/compute_attribute_test.rb
417
- - test/functional/config_group_test.rb
418
- - test/functional/usergroup_test.rb
395
+ - test/functional/bookmark_test.rb
396
+ - test/functional/mail_notification_test.rb
397
+ - test/functional/settings_test.rb
398
+ - test/functional/user_mail_notification_test.rb
419
399
  - test/functional/compute_resource_test.rb
420
400
  - test/functional/organization_test.rb
421
401
  - test/functional/report_template_test.rb
422
402
  - test/functional/user_test.rb
423
403
  - test/functional/virtual_machine_test.rb
424
- - test/functional/user_mail_notification_test.rb
404
+ - test/functional/architecture_test.rb
405
+ - test/functional/model_test.rb
406
+ - test/functional/compute_attribute_test.rb
425
407
  - test/functional/host_test.rb
426
408
  - test/functional/associating_commands_test.rb
427
409
  - test/functional/audit_test.rb
@@ -429,22 +411,23 @@ test_files:
429
411
  - test/functional/realm_test.rb
430
412
  - test/functional/role_test.rb
431
413
  - test/functional/status_test.rb
432
- - test/functional/bookmark_test.rb
433
- - test/functional/compute_profile_test.rb
434
- - test/functional/smart_class_parameter_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
435
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
423
  - test/unit/test_output_adapter.rb
441
- - test/unit/model_test.rb
424
+ - test/unit/host_test.rb
442
425
  - test/unit/auth_source_ldap_test.rb
443
426
  - test/unit/config_report_test.rb
444
427
  - test/unit/compute_resource_test.rb
445
428
  - test/unit/data/test_api.json
446
429
  - test/unit/defaults_test.rb
447
- - test/unit/operating_system_test.rb
430
+ - test/unit/architecture_test.rb
448
431
  - test/unit/external_usergroup_test.rb
449
432
  - test/unit/fact_test.rb
450
433
  - test/unit/helpers/fake_searchables.rb
@@ -453,27 +436,25 @@ test_files:
453
436
  - test/unit/image_test.rb
454
437
  - test/unit/location_test.rb
455
438
  - test/unit/messages_test.rb
456
- - test/unit/puppet_class_test.rb
439
+ - test/unit/bookmark_test.rb
457
440
  - test/unit/option_sources/id_params_test.rb
458
441
  - test/unit/option_sources/ids_params_test.rb
459
442
  - test/unit/organization_test.rb
460
443
  - test/unit/output/formatters_test.rb
461
444
  - test/unit/common_parameter_test.rb
462
- - test/unit/puppet_environment_test.rb
463
445
  - test/unit/realm_test.rb
464
- - test/unit/commands_test.rb
465
- - test/unit/compute_profile_test.rb
446
+ - test/unit/usergroup_test.rb
447
+ - test/unit/option_builders_test.rb
466
448
  - test/unit/subnet_test.rb
467
449
  - test/unit/test_helper.rb
468
450
  - test/unit/user_test.rb
469
451
  - test/unit/param_filters_test.rb
470
452
  - test/unit/partition_table_test.rb
471
453
  - test/unit/role_test.rb
472
- - test/unit/option_builders_test.rb
473
- - test/unit/host_test.rb
474
454
  - test/unit/hostgroup_test.rb
475
- - test/unit/id_resolver_test.rb
476
455
  - test/unit/mail_notification_test.rb
456
+ - test/unit/model_test.rb
457
+ - test/unit/operating_system_test.rb
477
458
  - test/unit/audit_test.rb
478
459
  - test/unit/auth_source_external.rb
479
460
  - test/unit/dependency_resolver_test.rb
@@ -482,14 +463,12 @@ test_files:
482
463
  - test/unit/media_test.rb
483
464
  - test/unit/sessions_test.rb
484
465
  - test/unit/apipie_resource_mock.rb
485
- - test/unit/config_group_test.rb
486
466
  - test/unit/api_test.rb
487
- - test/unit/settings_test.rb
488
- - test/unit/smart_class_parameter_test.rb
489
- - test/unit/usergroup_test.rb
490
- - test/unit/architecture_test.rb
491
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
492
471
  - test/unit/template_test.rb
493
- - test/unit/bookmark_test.rb
472
+ - test/unit/compute_profile_test.rb
494
473
  - test/unit/domain_test.rb
495
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
@@ -1,61 +0,0 @@
1
- require 'hammer_cli_foreman/smart_class_parameter'
2
-
3
- module HammerCLIForeman
4
-
5
- class PuppetClass < HammerCLIForeman::Command
6
-
7
- resource :puppetclasses
8
-
9
- class ListCommand < HammerCLIForeman::ListCommand
10
-
11
- output do
12
- field :id, _("Id")
13
- field :name, _("Name")
14
- end
15
-
16
- def send_request
17
- self.class.unhash_classes(super)
18
- end
19
-
20
- def self.unhash_classes(classes)
21
- clss = classes.first.inject([]) { |list, (pp_module, pp_module_classes)| list + pp_module_classes }
22
-
23
- HammerCLI::Output::RecordCollection.new(clss, :meta => classes.meta)
24
-
25
- end
26
-
27
- build_options
28
-
29
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
30
- end
31
-
32
-
33
- class InfoCommand < HammerCLIForeman::InfoCommand
34
- output ListCommand.output_definition do
35
- collection :smart_class_parameters, _("Smart class parameters"), :numbered => false do
36
- custom_field Fields::Reference, :name_key => :parameter
37
- end
38
- HammerCLIForeman::References.hostgroups(self)
39
- HammerCLIForeman::References.environments(self)
40
- HammerCLIForeman::References.parameters(self)
41
- end
42
-
43
- build_options
44
-
45
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
46
- end
47
-
48
-
49
- class SCParamsCommand < HammerCLIForeman::SmartClassParametersBriefList
50
- build_options_for :puppetclasses
51
-
52
- def validate_options
53
- super
54
- validator.any(:option_puppetclass_name, :option_puppetclass_id).required
55
- end
56
- end
57
-
58
- autoload_subcommands
59
- end
60
-
61
- end
@@ -1,65 +0,0 @@
1
- require 'hammer_cli'
2
- require 'hammer_cli_foreman/smart_class_parameter'
3
-
4
- module HammerCLIForeman
5
-
6
- class PuppetEnvironment < HammerCLIForeman::Command
7
-
8
- resource :environments
9
-
10
- class ListCommand < HammerCLIForeman::ListCommand
11
-
12
- output do
13
- field :id, _("Id")
14
- field :name, _("Name")
15
- end
16
-
17
- build_options
18
- end
19
-
20
-
21
- class InfoCommand < HammerCLIForeman::InfoCommand
22
- output ListCommand.output_definition do
23
- HammerCLIForeman::References.puppetclasses(self)
24
- HammerCLIForeman::References.taxonomies(self)
25
- HammerCLIForeman::References.timestamps(self)
26
- end
27
-
28
- build_options
29
- end
30
-
31
-
32
- class CreateCommand < HammerCLIForeman::CreateCommand
33
- success_message _("Environment created.")
34
- failure_message _("Could not create the environment")
35
-
36
- build_options
37
- end
38
-
39
-
40
- class UpdateCommand < HammerCLIForeman::UpdateCommand
41
- success_message _("Environment updated.")
42
- failure_message _("Could not update the environment")
43
-
44
- build_options
45
- end
46
-
47
-
48
- class DeleteCommand < HammerCLIForeman::DeleteCommand
49
- success_message _("Environment deleted.")
50
- failure_message _("Could not delete the environment")
51
-
52
- build_options
53
- end
54
-
55
- class SCParamsCommand < HammerCLIForeman::SmartClassParametersList
56
- build_options_for :environments
57
-
58
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
59
- end
60
-
61
-
62
- autoload_subcommands
63
- end
64
-
65
- end