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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a7510aa3b7250c6c467a18d128bc575f5a79f40c3a07283bb65def698e9c4cc
4
- data.tar.gz: e5b1cbbd810d718b84f6a0102883bd4825880efe10250bbd8af1688966f209f1
3
+ metadata.gz: 8287acd52ceb1bea84f8d518c3793d521d084ae771622ea7fc4dcccccd794a1b
4
+ data.tar.gz: b557d8fbbc7a451cd09084211c6e8a46a46ef3c198744cbb9c8dc7e861090e93
5
5
  SHA512:
6
- metadata.gz: e4112d9f91de37bfac6af33daf9d6e31d58d880889d421a873147dd75ac151c981849b641a90eb3322ca27add6b9dc8596f5a7fd8f6f95e830e1ffb3b8d3c5a5
7
- data.tar.gz: 137ee8f5c12f70577b438132a4b5c2a68bb12c0f54f06fbdf6ad4d6db4b514bdea654c6daf3f1150132061a4e519f43c3d75828df4b2ac1fd96e767be9f45894
6
+ metadata.gz: 283fd640422b5749f6dc9094907bb1c68e72cef15696704f4493f548dd23ca13bd1066fca15616996d4ff6ba48648d904f5633e3cc3305c30464fa9e22c8bf44
7
+ data.tar.gz: 94b81f8171c914bdd1435ad00a17c1b1606402bac1ab9b21ca3014056ed285029bc79fe2b0646630d964d3b4715bd94b42a67a35f5399cace731ec44c87e4ee8
data/doc/release_notes.md CHANGED
@@ -1,7 +1,16 @@
1
1
  Release notes
2
2
  =============
3
- ### 2.5.1 (2021-06-08)
3
+ ### 3.0.0 (2021-08-04)
4
+ * Puppet extraction ([PR #571](https://github.com/theforeman/hammer-cli-foreman/pull/571)), [#33174](http://projects.theforeman.org/issues/33174)
5
+ * Update rel-eng notebook ([PR #573](https://github.com/theforeman/hammer-cli-foreman/pull/573))
6
+ * Bump version to 3.0-develop
7
+ * Deprecate root-pass and remove deprecation warning, [#22574](http://projects.theforeman.org/issues/22574)
8
+ * Return org and loc options to all hammer commands ([PR #575](https://github.com/theforeman/hammer-cli-foreman/pull/575)), [#32872](http://projects.theforeman.org/issues/32872)
9
+ * prevent full-help from failure if apidoc not available ([PR #574](https://github.com/theforeman/hammer-cli-foreman/pull/574)), [#32861](http://projects.theforeman.org/issues/32861)
4
10
  * Show new msg for empty update commands, [#32454](http://projects.theforeman.org/issues/32454)
11
+ * Remove --environment deprecations ([PR #569](https://github.com/theforeman/hammer-cli-foreman/pull/569)), [#28862](http://projects.theforeman.org/issues/28862)
12
+ * Force name resolving due defaults, [#32392](http://projects.theforeman.org/issues/32392)
13
+ * Bump to 2.6.0-develop
5
14
 
6
15
  ### 2.5.0 (2021-05-04)
7
16
  * Update test data to latest foreman
@@ -60,15 +60,6 @@ module HammerCLIForeman
60
60
  'HammerCLIForeman::Domain', 'hammer_cli_foreman/domain'
61
61
  )
62
62
 
63
- HammerCLI::MainCommand.lazy_subcommand('environment', _("Manipulate environments"),
64
- 'HammerCLIForeman::PuppetEnvironment', 'hammer_cli_foreman/puppet_environment',
65
- :warning => _('%{env} command is deprecated and will be removed in one of the future versions. Please use %{puppet_env} command instead.') % {:env => 'environment', :puppet_env => 'puppet-environment'}
66
- )
67
-
68
- HammerCLI::MainCommand.lazy_subcommand('puppet-environment', _("Manipulate Puppet environments"),
69
- 'HammerCLIForeman::PuppetEnvironment', 'hammer_cli_foreman/puppet_environment'
70
- )
71
-
72
63
  HammerCLI::MainCommand.lazy_subcommand('fact', _("Search facts"),
73
64
  'HammerCLIForeman::Fact', 'hammer_cli_foreman/fact'
74
65
  )
@@ -113,10 +104,6 @@ module HammerCLIForeman
113
104
  'HammerCLIForeman::PartitionTable', 'hammer_cli_foreman/partition_table'
114
105
  )
115
106
 
116
- HammerCLI::MainCommand.lazy_subcommand('puppet-class', _("Search puppet modules"),
117
- 'HammerCLIForeman::PuppetClass', 'hammer_cli_foreman/puppet_class'
118
- )
119
-
120
107
  HammerCLI::MainCommand.lazy_subcommand('report', _("Browse and read reports"),
121
108
  'HammerCLIForeman::ConfigReport', 'hammer_cli_foreman/config_report',
122
109
  :warning => _('%{report} command is deprecated and will be removed in one of the future versions. Please use %{config_report} command instead.') % {:report => 'report', :config_report => 'config-report'}
@@ -134,10 +121,6 @@ module HammerCLIForeman
134
121
  'HammerCLIForeman::Role', 'hammer_cli_foreman/role'
135
122
  )
136
123
 
137
- HammerCLI::MainCommand.lazy_subcommand('sc-param', _("Manipulate smart class parameters"),
138
- 'HammerCLIForeman::SmartClassParameter', 'hammer_cli_foreman/smart_class_parameter'
139
- )
140
-
141
124
  HammerCLI::MainCommand.lazy_subcommand('proxy', _("Manipulate smart proxies"),
142
125
  'HammerCLIForeman::SmartProxy', 'hammer_cli_foreman/smart_proxy'
143
126
  )
@@ -166,10 +149,6 @@ module HammerCLIForeman
166
149
  'HammerCLIForeman::Usergroup', 'hammer_cli_foreman/usergroup'
167
150
  )
168
151
 
169
- HammerCLI::MainCommand.lazy_subcommand('config-group', _("Manipulate config groups"),
170
- 'HammerCLIForeman::ConfigGroup', 'hammer_cli_foreman/config_group'
171
- )
172
-
173
152
  HammerCLI::MainCommand.lazy_subcommand('ping', _("Get the status of the server and/or it's subcomponents"),
174
153
  'HammerCLIForeman::PingCommand', 'hammer_cli_foreman/ping'
175
154
  )
@@ -11,7 +11,7 @@ module HammerCLIForeman
11
11
  field :name, _("Name")
12
12
  end
13
13
 
14
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
14
+ build_options
15
15
  end
16
16
 
17
17
 
@@ -23,7 +23,7 @@ module HammerCLIForeman
23
23
  HammerCLIForeman::References.timestamps(self)
24
24
  end
25
25
 
26
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
26
+ build_options
27
27
  end
28
28
 
29
29
 
@@ -31,7 +31,7 @@ module HammerCLIForeman
31
31
  success_message _("Architecture created.")
32
32
  failure_message _("Could not create the architecture")
33
33
 
34
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
34
+ build_options
35
35
  end
36
36
 
37
37
 
@@ -39,7 +39,7 @@ module HammerCLIForeman
39
39
  success_message _("Architecture deleted.")
40
40
  failure_message _("Could not delete the architecture")
41
41
 
42
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
42
+ build_options
43
43
  end
44
44
 
45
45
 
@@ -47,7 +47,7 @@ module HammerCLIForeman
47
47
  success_message _("Architecture updated.")
48
48
  failure_message _("Could not update the architecture")
49
49
 
50
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
50
+ build_options
51
51
  end
52
52
 
53
53
  HammerCLIForeman::AssociatingCommands::OperatingSystem.extend_command(self)
@@ -53,30 +53,6 @@ module HammerCLIForeman
53
53
  end
54
54
  end
55
55
 
56
- module PuppetEnvironment
57
- extend CommandExtension
58
-
59
- class AddPuppetEnvironmentCommand < HammerCLIForeman::AddAssociatedCommand
60
- associated_resource :environments
61
- desc _('Associate a Puppet environment')
62
-
63
- success_message _("The environment has been associated.")
64
- failure_message _("Could not associate the environment")
65
-
66
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
67
- end
68
-
69
- class RemovePuppetEnvironmentCommand < HammerCLIForeman::RemoveAssociatedCommand
70
- associated_resource :environments
71
- desc _('Disassociate a Puppet environment')
72
-
73
- success_message _("The environment has been disassociated.")
74
- failure_message _("Could not disassociate the environment")
75
-
76
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
77
- end
78
- end
79
-
80
56
  module Domain
81
57
  extend CommandExtension
82
58
 
@@ -15,34 +15,34 @@ module HammerCLIForeman
15
15
  field :owner_type, _('Owner Type')
16
16
  end
17
17
 
18
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
18
+ build_options
19
19
  end
20
20
 
21
21
  class InfoCommand < HammerCLIForeman::InfoCommand
22
22
  output ListCommand.output_definition
23
23
 
24
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
24
+ build_options
25
25
  end
26
26
 
27
27
  class CreateCommand < HammerCLIForeman::CreateCommand
28
28
  success_message _('Bookmark %<name>s created.')
29
29
  failure_message _('Failed to create %<name>s bookmark')
30
30
 
31
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
31
+ build_options
32
32
  end
33
33
 
34
34
  class UpdateCommand < HammerCLIForeman::UpdateCommand
35
35
  success_message _('Bookmark %<name>s updated successfully.')
36
36
  failure_message _('Failed to update %<name>s bookmark')
37
37
 
38
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
38
+ build_options
39
39
  end
40
40
 
41
41
  class DeleteCommand < HammerCLIForeman::DeleteCommand
42
42
  success_message _('Bookmark deleted successfully.')
43
43
  failure_message _('Failed to delete bookmark')
44
44
 
45
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
45
+ build_options
46
46
  end
47
47
 
48
48
  autoload_subcommands
@@ -6,8 +6,7 @@ module HammerCLIForeman
6
6
 
7
7
  module RequestParams
8
8
  def request_params
9
- combination_params = { 'hostgroup_id' => params['hostgroup_id'].to_s,
10
- 'environment_id' => params['environment_id'].to_s }
9
+ combination_params = { 'hostgroup_id' => params['hostgroup_id'].to_s }
11
10
  super.merge('template_combination' => combination_params)
12
11
  end
13
12
  end
@@ -21,8 +20,6 @@ module HammerCLIForeman
21
20
  field :provisioning_template_name, _('Provisioning template name')
22
21
  field :hostgroup_id, _('Hostgroup ID')
23
22
  field :hostgroup_name, _('Hostgroup name')
24
- field :environment_id, _('Environment ID')
25
- field :environment_name, _('Environment name')
26
23
 
27
24
  HammerCLIForeman::References.taxonomies(self)
28
25
  HammerCLIForeman::References.timestamps(self)
@@ -31,8 +28,6 @@ module HammerCLIForeman
31
28
  build_options do |o|
32
29
  o.expand(:all)
33
30
  end
34
-
35
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
36
31
  end
37
32
 
38
33
  class ListCombination < HammerCLIForeman::ListCommand
@@ -40,12 +35,11 @@ module HammerCLIForeman
40
35
  field :id, _('ID')
41
36
  field nil, _('Provisioning Template'), Fields::SingleReference, :key => :provisioning_template
42
37
  field nil, _('Hostgroup'), Fields::SingleReference, :key => :hostgroup
43
- field nil, _('Environment'), Fields::SingleReference, :key => :environment
44
38
  end
45
39
 
46
40
  build_options do |o|
47
- o.expand(:all).except(:hostgroups, :environments)
48
- o.without(:hostgroup_id, :environment_id)
41
+ o.expand(:all).except(:hostgroups)
42
+ o.without(:hostgroup_id)
49
43
  end
50
44
  end
51
45
 
@@ -58,8 +52,6 @@ module HammerCLIForeman
58
52
  build_options do |o|
59
53
  o.expand(:all)
60
54
  end
61
-
62
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
63
55
  end
64
56
 
65
57
  class CreateCombination < HammerCLIForeman::CreateCommand
@@ -71,8 +63,6 @@ module HammerCLIForeman
71
63
  build_options do |o|
72
64
  o.expand(:all)
73
65
  end
74
-
75
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
76
66
  end
77
67
 
78
68
  class DeleteCombination < HammerCLIForeman::DeleteCommand
@@ -1,7 +1,5 @@
1
1
  require 'hammer_cli_foreman/command_extensions/update_common'
2
2
  require 'hammer_cli_foreman/command_extensions/fields'
3
- require 'hammer_cli_foreman/command_extensions/puppet_environment'
4
- require 'hammer_cli_foreman/command_extensions/puppet_environments'
5
3
  require 'hammer_cli_foreman/command_extensions/option_sources'
6
4
  require 'hammer_cli_foreman/command_extensions/hosts'
7
5
  require 'hammer_cli_foreman/command_extensions/ping'
@@ -7,16 +7,9 @@ module HammerCLIForeman
7
7
  :usergroups => :user_groups,
8
8
  :ptable => :partition_table,
9
9
  :ptables => :partition_tables,
10
- :puppetclass => :puppet_class,
11
- :puppetclasses => :puppet_classes,
12
- :environment => :puppet_environment,
13
- :environments => :puppet_environments
14
10
  }
15
11
 
16
- RESOURCE_ALIAS_NAME_MAPPING = {
17
- environment: :puppet_environment,
18
- environments: :puppet_environments
19
- }
12
+ RESOURCE_ALIAS_NAME_MAPPING = { }
20
13
 
21
14
  def self.foreman_api
22
15
  foreman_api_connection
@@ -294,7 +287,7 @@ module HammerCLIForeman
294
287
  def help
295
288
  return super unless resource
296
289
 
297
- meta = resource.action(action).apidoc[:metadata]
290
+ meta = resource.action(action).apidoc&.dig(:metadata)
298
291
  if meta && meta[:search] && respond_to?(:option_search)
299
292
  self.class.extend_help do |h|
300
293
  h.section(_('Search / Order fields'), id: :search_fields_section) do |h|
@@ -9,7 +9,7 @@ module HammerCLIForeman
9
9
  field :id, _('Id')
10
10
  field :name, _('Name')
11
11
  end
12
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
12
+ build_options
13
13
  end
14
14
 
15
15
  class InfoCommand < HammerCLIForeman::InfoCommand
@@ -25,13 +25,13 @@ module HammerCLIForeman
25
25
  field :vm_attrs, _('VM attributes')
26
26
  end
27
27
  end
28
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
28
+ build_options
29
29
  end
30
30
 
31
31
  class CreateCommand < HammerCLIForeman::CreateCommand
32
32
  success_message _('Compute profile created.')
33
33
  failure_message _('Could not create a compute profile')
34
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
34
+ build_options
35
35
  end
36
36
 
37
37
  class UpdateCommand < HammerCLIForeman::UpdateCommand
@@ -40,7 +40,7 @@ module HammerCLIForeman
40
40
  validate_options do
41
41
  any(:option_name,:option_id).required
42
42
  end
43
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
43
+ build_options
44
44
  end
45
45
 
46
46
  class DeleteCommand < HammerCLIForeman::DeleteCommand
@@ -49,7 +49,7 @@ module HammerCLIForeman
49
49
  validate_options do
50
50
  any(:option_name,:option_id).required
51
51
  end
52
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
52
+ build_options
53
53
  end
54
54
 
55
55
  lazy_subcommand('values', _("Create update and delete Compute profile values"),
@@ -1,7 +1,5 @@
1
1
  require 'hammer_cli_foreman/fact'
2
2
  require 'hammer_cli_foreman/config_report'
3
- require 'hammer_cli_foreman/puppet_class'
4
- require 'hammer_cli_foreman/smart_class_parameter'
5
3
  require 'hammer_cli_foreman/interface'
6
4
  require 'hammer_cli_foreman/hosts/common_update_options'
7
5
  require 'hammer_cli_foreman/compute_resource/register_compute_resources'
@@ -31,8 +29,6 @@ module HammerCLIForeman
31
29
  end
32
30
 
33
31
  build_options :without => [:include]
34
-
35
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
36
32
  end
37
33
 
38
34
 
@@ -58,9 +54,6 @@ module HammerCLIForeman
58
54
  field nil, _("Host Group"), Fields::SingleReference, :key => :hostgroup, :display_field => 'title'
59
55
  field nil, _("Compute Resource"), Fields::SingleReference, :key => :compute_resource
60
56
  field nil, _("Compute Profile"), Fields::SingleReference, :key => :compute_profile, :hide_blank => true
61
- field nil, _("Puppet Environment"), Fields::SingleReference, :key => :environment
62
- field nil, _("Puppet CA Proxy"), Fields::SingleReference, :key => :puppet_ca_proxy
63
- field nil, _("Puppet Master Proxy"), Fields::SingleReference, :key => :puppet_proxy
64
57
  field :certname, _("Cert name")
65
58
  field :managed, _("Managed"), Fields::Boolean
66
59
 
@@ -191,23 +184,6 @@ module HammerCLIForeman
191
184
  build_options
192
185
  end
193
186
 
194
-
195
- class PuppetClassesCommand < HammerCLIForeman::ListCommand
196
- command_name "puppet-classes"
197
- resource :puppetclasses
198
-
199
- output HammerCLIForeman::PuppetClass::ListCommand.output_definition
200
-
201
- def send_request
202
- HammerCLIForeman::PuppetClass::ListCommand.unhash_classes(super)
203
- end
204
-
205
- build_options do |o|
206
- o.without(:hostgroup_id, :environment_id)
207
- o.expand.only(:hosts)
208
- end
209
- end
210
-
211
187
  class ConfigReportsCommand < HammerCLIForeman::ListCommand
212
188
  command_name 'config-reports'
213
189
  resource :config_reports, :index
@@ -293,7 +269,6 @@ module HammerCLIForeman
293
269
  end
294
270
  end
295
271
 
296
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
297
272
  extend_with(HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces.new)
298
273
  extend_with(HammerCLIForeman::CommandExtensions::Hosts::Help::ComputeResources.custom(add_host_specific_attrs: true).new)
299
274
  end
@@ -324,7 +299,6 @@ module HammerCLIForeman
324
299
  sources
325
300
  end
326
301
 
327
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
328
302
  extend_with(HammerCLIForeman::CommandExtensions::Hosts::Help::Interfaces.new)
329
303
  extend_with(HammerCLIForeman::CommandExtensions::Hosts::Help::ComputeResources.custom(add_host_specific_attrs: true).new)
330
304
  end
@@ -457,15 +431,6 @@ module HammerCLIForeman
457
431
  build_options without: [:power_action]
458
432
  end
459
433
 
460
- class SCParamsCommand < HammerCLIForeman::SmartClassParametersList
461
- build_options_for :hosts
462
-
463
- def validate_options
464
- super
465
- validator.any(:option_host_name, :option_host_id).required
466
- end
467
- end
468
-
469
434
  class RebuildConfigCommand < HammerCLIForeman::SingleResourceCommand
470
435
  action :rebuild_config
471
436
  command_name "rebuild-config"
@@ -1,25 +1,12 @@
1
- require 'hammer_cli_foreman/smart_class_parameter'
2
- require 'hammer_cli_foreman/puppet_class'
3
-
4
1
  module HammerCLIForeman
5
2
 
6
3
  module HostgroupUpdateCreateCommons
7
4
 
8
5
  def self.included(base)
9
- base.option "--puppet-class-ids", "PUPPETCLASS_IDS", _("List of puppetclass ids"),
10
- :format => HammerCLI::Options::Normalizers::List.new,
11
- :attribute_name => :option_puppetclass_ids
12
- base.option "--puppet-classes", "PUPPET_CLASS_NAMES", "",
13
- :format => HammerCLI::Options::Normalizers::List.new,
14
- :attribute_name => :option_puppetclass_names
15
- base.option "--puppet-ca-proxy", "PUPPET_CA_PROXY_NAME", _("Name of puppet CA proxy")
16
- base.option "--puppet-proxy", "PUPPET_PROXY_NAME", _("Name of puppet proxy")
17
6
  base.option "--parent", "PARENT_NAME", _("Name of parent hostgroup")
18
- base.option ["--root-password", "--root-pass"], "ROOT_PASSWORD", _("Root password"),
19
- deprecated: { '--root-pass' => _("Use --root-password instead") }
7
+ base.option ["--root-password"], "ROOT_PASSWORD", _("Root password")
20
8
  base.option ["--ask-root-password", "--ask-root-pass"], "ASK_ROOT_PW", "",
21
- format: HammerCLI::Options::Normalizers::Bool.new,
22
- deprecated: { '--ask-root-pass' => _("Use --ask-root-password instead") }
9
+ format: HammerCLI::Options::Normalizers::Bool.new
23
10
  base.option "--subnet6", "SUBNET6_NAME", _("Subnet IPv6 name")
24
11
 
25
12
  base.build_options without: %i[root_pass]
@@ -33,8 +20,6 @@ module HammerCLIForeman
33
20
  def request_params
34
21
  params = super
35
22
  params['hostgroup']["parent_id"] ||= resolver.hostgroup_id('option_name' => option_parent) if option_parent
36
- params['hostgroup']["puppet_proxy_id"] ||= proxy_id(option_puppet_proxy) if option_puppet_proxy
37
- params['hostgroup']["puppet_ca_proxy_id"] ||= proxy_id(option_puppet_ca_proxy) if option_puppet_ca_proxy
38
23
 
39
24
  params['hostgroup']['root_pass'] = option_root_password if option_root_password
40
25
  params['hostgroup']['root_pass'] = HammerCLIForeman::HostgroupUpdateCreateCommons::ask_password if option_ask_root_password
@@ -61,7 +46,6 @@ module HammerCLIForeman
61
46
  field :name, _("Name")
62
47
  field :title, _("Title")
63
48
  field nil, _("Operating System"), Fields::SingleReference, :key => :operatingsystem
64
- field nil, _("Puppet Environment"), Fields::SingleReference, :key => :environment
65
49
  field nil, _("Model"), Fields::SingleReference, :key => :model
66
50
  end
67
51
 
@@ -75,13 +59,10 @@ module HammerCLIForeman
75
59
  field :id, _("Id")
76
60
  field :name, _("Name")
77
61
  field :title, _("Title")
78
- field nil, _("Puppet Environment"), Fields::SingleReference, :key => :environment
79
62
  field nil, _("Model"), Fields::SingleReference, :key => :model
80
63
 
81
64
  field :description, _("Description"), Fields::LongText, :hide_blank => true
82
65
  field nil, _("Parent"), Fields::SingleReference, :key => :parent, :hide_blank => true
83
- field nil, _("Puppet CA Proxy"), Fields::SingleReference, :key => :puppet_ca_proxy
84
- field nil, _("Puppet Master Proxy"), Fields::SingleReference, :key => :puppet_proxy
85
66
  field nil, _("Compute Profile"), Fields::SingleReference, :key => :compute_profile
86
67
  field nil, _("Compute Resource"), Fields::SingleReference, :key => :compute_resource
87
68
  label _('Network') do
@@ -97,7 +78,6 @@ module HammerCLIForeman
97
78
  field nil, _("Partition Table"), Fields::SingleReference, :key => :ptable
98
79
  field :pxe_loader, _("PXE Loader"), Fields::Field, :hide_blank => true
99
80
  end
100
- HammerCLIForeman::References.puppetclasses(self)
101
81
  HammerCLIForeman::References.parameters(self)
102
82
  HammerCLIForeman::References.taxonomies(self)
103
83
  end
@@ -111,8 +91,6 @@ module HammerCLIForeman
111
91
 
112
92
  success_message _("Hostgroup created.")
113
93
  failure_message _("Could not create the hostgroup")
114
-
115
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
116
94
  end
117
95
 
118
96
 
@@ -121,8 +99,6 @@ module HammerCLIForeman
121
99
 
122
100
  success_message _("Hostgroup updated.")
123
101
  failure_message _("Could not update the hostgroup")
124
-
125
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
126
102
  end
127
103
 
128
104
 
@@ -133,24 +109,6 @@ module HammerCLIForeman
133
109
  build_options
134
110
  end
135
111
 
136
-
137
- class PuppetClassesCommand < HammerCLIForeman::ListCommand
138
- command_name "puppet-classes"
139
- resource :puppetclasses
140
-
141
- output HammerCLIForeman::PuppetClass::ListCommand.output_definition
142
-
143
- def send_request
144
- HammerCLIForeman::PuppetClass::ListCommand.unhash_classes(super)
145
- end
146
-
147
- build_options do |o|
148
- o.without(:host_id, :environment_id)
149
- o.expand.only(:hostgroups)
150
- end
151
- end
152
-
153
-
154
112
  class SetParameterCommand < HammerCLIForeman::Parameter::SetCommand
155
113
  desc _("Create or update parameter for a hostgroup")
156
114
 
@@ -170,15 +128,6 @@ module HammerCLIForeman
170
128
  build_options
171
129
  end
172
130
 
173
- class SCParamsCommand < HammerCLIForeman::SmartClassParametersList
174
- build_options_for :hostgroups
175
-
176
- def validate_options
177
- super
178
- validator.any(:option_hostgroup_name, :option_hostgroup_id).required
179
- end
180
- end
181
-
182
131
  class RebuildConfigCommand < HammerCLIForeman::SingleResourceCommand
183
132
  action :rebuild_config
184
133
  command_name "rebuild-config"