hammer_cli_foreman 2.5.1 → 3.2.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 (104) hide show
  1. checksums.yaml +4 -4
  2. data/doc/release_notes.md +31 -1
  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/domain.rb +20 -0
  8. data/lib/hammer_cli_foreman/command_extensions/subnet.rb +25 -10
  9. data/lib/hammer_cli_foreman/command_extensions/user.rb +9 -5
  10. data/lib/hammer_cli_foreman/command_extensions.rb +1 -2
  11. data/lib/hammer_cli_foreman/commands.rb +3 -11
  12. data/lib/hammer_cli_foreman/compute_attribute.rb +1 -1
  13. data/lib/hammer_cli_foreman/compute_profile.rb +5 -5
  14. data/lib/hammer_cli_foreman/compute_resource/libvirt.rb +4 -2
  15. data/lib/hammer_cli_foreman/compute_resource/vmware.rb +4 -2
  16. data/lib/hammer_cli_foreman/compute_resource.rb +1 -0
  17. data/lib/hammer_cli_foreman/domain.rb +5 -28
  18. data/lib/hammer_cli_foreman/filter.rb +3 -3
  19. data/lib/hammer_cli_foreman/host.rb +1 -35
  20. data/lib/hammer_cli_foreman/hostgroup.rb +14 -58
  21. data/lib/hammer_cli_foreman/hosts/common_update_options.rb +8 -30
  22. data/lib/hammer_cli_foreman/id_resolver.rb +7 -68
  23. data/lib/hammer_cli_foreman/location.rb +0 -6
  24. data/lib/hammer_cli_foreman/mail_notification.rb +2 -2
  25. data/lib/hammer_cli_foreman/model.rb +5 -5
  26. data/lib/hammer_cli_foreman/operating_system.rb +10 -10
  27. data/lib/hammer_cli_foreman/option_builders.rb +65 -53
  28. data/lib/hammer_cli_foreman/option_sources/id_params.rb +41 -11
  29. data/lib/hammer_cli_foreman/option_sources/ids_params.rb +39 -7
  30. data/lib/hammer_cli_foreman/option_sources.rb +0 -1
  31. data/lib/hammer_cli_foreman/organization.rb +0 -6
  32. data/lib/hammer_cli_foreman/references.rb +0 -16
  33. data/lib/hammer_cli_foreman/settings.rb +3 -3
  34. data/lib/hammer_cli_foreman/smart_proxy.rb +7 -57
  35. data/lib/hammer_cli_foreman/template.rb +3 -15
  36. data/lib/hammer_cli_foreman/user.rb +5 -4
  37. data/lib/hammer_cli_foreman/usergroup.rb +5 -5
  38. data/lib/hammer_cli_foreman/version.rb +1 -1
  39. data/lib/hammer_cli_foreman.rb +0 -21
  40. data/lib/minitest/coverage_reporter.rb +1 -1
  41. data/locale/ca/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  42. data/locale/de/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  43. data/locale/en/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  44. data/locale/en_GB/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  45. data/locale/es/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  46. data/locale/fr/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  47. data/locale/it/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  48. data/locale/ja/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  49. data/locale/ko/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  50. data/locale/pt_BR/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  51. data/locale/ru/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  52. data/locale/zh_CN/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  53. data/locale/zh_TW/LC_MESSAGES/hammer-cli-foreman.mo +0 -0
  54. data/test/data/3.1/foreman_api.json +1 -0
  55. data/test/functional/architecture_test.rb +6 -4
  56. data/test/functional/bookmark_test.rb +3 -1
  57. data/test/functional/compute_attribute_test.rb +20 -20
  58. data/test/functional/compute_profile_test.rb +3 -1
  59. data/test/functional/domain/create_test.rb +91 -0
  60. data/test/functional/domain/update_test.rb +90 -0
  61. data/test/functional/host_test.rb +34 -1
  62. data/test/functional/hostgroup/create_test.rb +11 -117
  63. data/test/functional/hostgroup/update_test.rb +11 -79
  64. data/test/functional/location_test.rb +0 -3
  65. data/test/functional/mail_notification_test.rb +3 -1
  66. data/test/functional/model_test.rb +3 -1
  67. data/test/functional/operating_system_test.rb +3 -1
  68. data/test/functional/personal_access_token_test.rb +4 -4
  69. data/test/functional/settings_test.rb +4 -4
  70. data/test/functional/template_test.rb +76 -49
  71. data/test/functional/user_mail_notification_test.rb +3 -3
  72. data/test/functional/usergroup_test.rb +3 -1
  73. data/test/test_helper.rb +1 -1
  74. data/test/unit/apipie_resource_mock.rb +1 -39
  75. data/test/unit/architecture_test.rb +10 -10
  76. data/test/unit/bookmark_test.rb +10 -14
  77. data/test/unit/commands_test.rb +1 -2
  78. data/test/unit/compute_profile_test.rb +10 -10
  79. data/test/unit/helpers/command.rb +0 -8
  80. data/test/unit/host_test.rb +14 -61
  81. data/test/unit/hostgroup_test.rb +7 -26
  82. data/test/unit/id_resolver_test.rb +0 -28
  83. data/test/unit/mail_notification_test.rb +4 -4
  84. data/test/unit/model_test.rb +47 -47
  85. data/test/unit/operating_system_test.rb +10 -16
  86. data/test/unit/option_builders_test.rb +88 -83
  87. data/test/unit/settings_test.rb +4 -4
  88. data/test/unit/smart_proxy_test.rb +0 -12
  89. data/test/unit/usergroup_test.rb +10 -10
  90. metadata +70 -84
  91. data/lib/hammer_cli_foreman/command_extensions/puppet_environment.rb +0 -29
  92. data/lib/hammer_cli_foreman/command_extensions/puppet_environments.rb +0 -29
  93. data/lib/hammer_cli_foreman/config_group.rb +0 -45
  94. data/lib/hammer_cli_foreman/option_sources/puppet_environment_params.rb +0 -59
  95. data/lib/hammer_cli_foreman/puppet_class.rb +0 -61
  96. data/lib/hammer_cli_foreman/puppet_environment.rb +0 -65
  97. data/lib/hammer_cli_foreman/smart_class_parameter.rb +0 -189
  98. data/test/functional/config_group_test.rb +0 -50
  99. data/test/functional/proxy_test.rb +0 -86
  100. data/test/functional/smart_class_parameter_test.rb +0 -97
  101. data/test/unit/config_group_test.rb +0 -82
  102. data/test/unit/puppet_class_test.rb +0 -72
  103. data/test/unit/puppet_environment_test.rb +0 -114
  104. data/test/unit/smart_class_parameter_test.rb +0 -113
@@ -1,28 +1,22 @@
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
- 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") }
20
- 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") }
23
- base.option "--subnet6", "SUBNET6_NAME", _("Subnet IPv6 name")
6
+ base.option '--root-password', 'ROOT_PASSWORD', _('Root password')
7
+ base.option '--ask-root-password', 'ASK_ROOT_PW', '',
8
+ format: HammerCLI::Options::Normalizers::Bool.new
24
9
 
25
10
  base.build_options without: %i[root_pass]
11
+
12
+ base.option_family associate: 'subnet6' do
13
+ child '--subnet6', 'SUBNET6_NAME', _('Subnet IPv6 name')
14
+ end
15
+
16
+ base.option_family associate: 'parent' do
17
+ child '--parent', 'PARENT_NAME', _('Name of parent hostgroup')
18
+ child '--parent-title', 'PARENT_TITLE', _('Title of parent hostgroup')
19
+ end
26
20
  end
27
21
 
28
22
  def self.ask_password
@@ -32,10 +26,8 @@ module HammerCLIForeman
32
26
 
33
27
  def request_params
34
28
  params = super
35
- 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
-
29
+ params['hostgroup']['parent_id'] ||= resolver.hostgroup_id('option_name' => option_parent) if option_parent
30
+ params['hostgroup']['parent_id'] ||= resolver.hostgroup_id('option_title' => option_parent_title) if option_parent_title
39
31
  params['hostgroup']['root_pass'] = option_root_password if option_root_password
40
32
  params['hostgroup']['root_pass'] = HammerCLIForeman::HostgroupUpdateCreateCommons::ask_password if option_ask_root_password
41
33
 
@@ -61,7 +53,6 @@ module HammerCLIForeman
61
53
  field :name, _("Name")
62
54
  field :title, _("Title")
63
55
  field nil, _("Operating System"), Fields::SingleReference, :key => :operatingsystem
64
- field nil, _("Puppet Environment"), Fields::SingleReference, :key => :environment
65
56
  field nil, _("Model"), Fields::SingleReference, :key => :model
66
57
  end
67
58
 
@@ -75,13 +66,10 @@ module HammerCLIForeman
75
66
  field :id, _("Id")
76
67
  field :name, _("Name")
77
68
  field :title, _("Title")
78
- field nil, _("Puppet Environment"), Fields::SingleReference, :key => :environment
79
69
  field nil, _("Model"), Fields::SingleReference, :key => :model
80
70
 
81
71
  field :description, _("Description"), Fields::LongText, :hide_blank => true
82
72
  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
73
  field nil, _("Compute Profile"), Fields::SingleReference, :key => :compute_profile
86
74
  field nil, _("Compute Resource"), Fields::SingleReference, :key => :compute_resource
87
75
  label _('Network') do
@@ -97,7 +85,6 @@ module HammerCLIForeman
97
85
  field nil, _("Partition Table"), Fields::SingleReference, :key => :ptable
98
86
  field :pxe_loader, _("PXE Loader"), Fields::Field, :hide_blank => true
99
87
  end
100
- HammerCLIForeman::References.puppetclasses(self)
101
88
  HammerCLIForeman::References.parameters(self)
102
89
  HammerCLIForeman::References.taxonomies(self)
103
90
  end
@@ -111,8 +98,6 @@ module HammerCLIForeman
111
98
 
112
99
  success_message _("Hostgroup created.")
113
100
  failure_message _("Could not create the hostgroup")
114
-
115
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
116
101
  end
117
102
 
118
103
 
@@ -121,8 +106,6 @@ module HammerCLIForeman
121
106
 
122
107
  success_message _("Hostgroup updated.")
123
108
  failure_message _("Could not update the hostgroup")
124
-
125
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironment.new)
126
109
  end
127
110
 
128
111
 
@@ -133,24 +116,6 @@ module HammerCLIForeman
133
116
  build_options
134
117
  end
135
118
 
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
119
  class SetParameterCommand < HammerCLIForeman::Parameter::SetCommand
155
120
  desc _("Create or update parameter for a hostgroup")
156
121
 
@@ -170,15 +135,6 @@ module HammerCLIForeman
170
135
  build_options
171
136
  end
172
137
 
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
138
  class RebuildConfigCommand < HammerCLIForeman::SingleResourceCommand
183
139
  action :rebuild_config
184
140
  command_name "rebuild-config"
@@ -3,33 +3,18 @@ module HammerCLIForeman
3
3
  module CommonUpdateOptions
4
4
 
5
5
  def self.included(base)
6
- base.option "--owner", "OWNER_LOGIN", _("Login of the owner"),
7
- :attribute_name => :option_user_login
8
- base.option "--owner-id", "OWNER_ID", _("ID of the owner"),
9
- :attribute_name => :option_owner_id
10
-
6
+ base.option_family do
7
+ parent '--owner-id', 'OWNER_ID', _('ID of the owner'),
8
+ attribute_name: :option_owner_id
9
+ child '--owner', 'OWNER_LOGIN', _('Login of the owner'),
10
+ attribute_name: :option_user_login
11
+ end
11
12
  base.option "--root-password", "ROOT_PW",
12
13
  _("Required if host is managed and value is not inherited from host group or default password in settings")
13
14
 
14
15
  base.option "--ask-root-password", "ASK_ROOT_PW", " ",
15
16
  :format => HammerCLI::Options::Normalizers::Bool.new
16
17
 
17
- base.option '--puppet-proxy', 'PUPPET_PROXY_NAME', '',
18
- referenced_resource: 'puppet_proxy',
19
- aliased_resource: 'puppet_proxy'
20
- base.option '--puppet-ca-proxy', 'PUPPET_CA_PROXY_NAME', '',
21
- referenced_resource: 'puppet_ca_proxy',
22
- aliased_resource: 'puppet_ca_proxy'
23
- base.option_family(
24
- format: HammerCLI::Options::Normalizers::List.new,
25
- aliased_resource: 'puppet-class',
26
- description: 'Names/Ids of associated puppet classes'
27
- ) do
28
- parent '--puppet-class-ids', 'PUPPET_CLASS_IDS', '',
29
- attribute_name: :option_puppetclass_ids
30
- child '--puppet-classes', 'PUPPET_CLASS_NAMES', '',
31
- attribute_name: :option_puppetclass_names
32
- end
33
18
  bme_options = {}
34
19
  bme_options[:default] = 'true' if base.action.to_sym == :create
35
20
 
@@ -56,7 +41,7 @@ module HammerCLIForeman
56
41
  :capabilities, :flavour_ref, :image_ref, :start,
57
42
  :network, :cpus, :memory, :provider, :type, :tenant_id, :image_id,
58
43
  # ----------------------------------------------------------------------------------
59
- :puppet_class_ids, :host_parameters_attributes, :interfaces_attributes, :root_pass]
44
+ :host_parameters_attributes, :interfaces_attributes, :root_pass]
60
45
  end
61
46
 
62
47
  def self.ask_password
@@ -69,12 +54,6 @@ module HammerCLIForeman
69
54
  owner_id = owner_id(option_user_login, params['host']['owner_type'])
70
55
  params['host']['owner_id'] ||= owner_id unless owner_id.nil?
71
56
 
72
- puppet_proxy_id = proxy_id(option_puppet_proxy)
73
- params['host']['puppet_proxy_id'] ||= puppet_proxy_id unless puppet_proxy_id.nil?
74
-
75
- puppet_ca_proxy_id = proxy_id(option_puppet_ca_proxy)
76
- params['host']['puppet_ca_proxy_id'] ||= puppet_ca_proxy_id unless puppet_ca_proxy_id.nil?
77
-
78
57
  if action == :create
79
58
  params['host']['build'] = true if option_build.nil?
80
59
  params['host']['managed'] = true if option_managed.nil?
@@ -134,14 +113,13 @@ module HammerCLIForeman
134
113
 
135
114
  private
136
115
 
137
-
138
116
  def owner_id(name, type)
139
117
  return unless name
140
118
  return resolver.usergroup_id('option_name' => name) if type == 'Usergroup'
141
119
 
142
120
  resolver.user_id('option_login' => name)
143
121
  end
144
-
122
+
145
123
  def proxy_id(name)
146
124
  resolver.smart_proxy_id('option_name' => name) if name
147
125
  end
@@ -1,14 +1,12 @@
1
1
  module HammerCLIForeman
2
2
 
3
3
  class Searchable
4
- attr_reader :name, :description, :format
4
+ attr_reader :name, :description
5
5
 
6
6
  def initialize(name, description, options={})
7
7
  @name = name
8
8
  @description = description
9
9
  @editable = options[:editable].nil? ? true : options[:editable]
10
- @format = options[:format]
11
- @parent = options[:parent]
12
10
  end
13
11
 
14
12
  def plural_name
@@ -18,10 +16,6 @@ module HammerCLIForeman
18
16
  def editable?
19
17
  @editable
20
18
  end
21
-
22
- def parent?
23
- @parent
24
- end
25
19
  end
26
20
 
27
21
  class Searchables
@@ -42,8 +36,6 @@ module HammerCLIForeman
42
36
  :compute_resource => [ s_name(_("Compute resource name")) ],
43
37
  :compute_profile => [ s_name(_("Compute profile name")) ],
44
38
  :domain => [ s_name(_("Domain name")) ],
45
- :environment => [s_name(_('Puppet environment name'))],
46
- :puppet_environment => [s_name(_('Puppet environment name'))],
47
39
  :fact_value => [],
48
40
  :filter => [],
49
41
  :host => [ s_name(_("Host name")) ],
@@ -66,7 +58,6 @@ module HammerCLIForeman
66
58
  :override_value => [],
67
59
  :ptable => [ s_name(_("Partition table name")) ],
68
60
  :proxy => [ s_name(_("Proxy name")) ],
69
- :puppetclass => [ s_name(_("Puppet class name")) ],
70
61
  :config_report => [],
71
62
  :role => [ s_name(_("User role name")) ],
72
63
  :setting => [ s_name(_("Setting name"), :editable => false) ],
@@ -74,7 +65,6 @@ module HammerCLIForeman
74
65
  :template => [],
75
66
  :user => [ s("login", _("User's login to search by")) ],
76
67
  :common_parameter => [ s_name(_("Common parameter name")) ],
77
- :smart_class_parameter => [ s_name(_("Smart class parameter name"), :editable => false) ],
78
68
  :template_combination => [],
79
69
  :compute_attribute => []
80
70
  }
@@ -129,49 +119,17 @@ module HammerCLIForeman
129
119
  scoped_options
130
120
  end
131
121
 
132
- def puppetclass_ids(options)
133
- resource_name = :puppetclasses
134
- resource = @api.resource(resource_name)
135
- results = if (ids = options[HammerCLI.option_accessor_name("ids")])
136
- ids
137
- elsif (ids = nil_from_searchables(resource_name, options, :plural => true))
138
- ids
139
- elsif options_not_set?(resource, options)
140
- raise MissingSearchOptions.new(_("Missing options to search %s") % resource.name, resource)
141
- elsif options_empty?(resource, options)
142
- []
143
- else
144
- require('hammer_cli_foreman/puppet_class')
145
- results = HammerCLIForeman::PuppetClass::ListCommand.unhash_classes(
146
- resolved_call(resource_name, :index, options, :multi)
147
- )
148
- raise ResolverError.new(_("one of %s not found.") % resource.name, resource) if results.count < expected_record_count(options, resource, :multi)
149
-
150
- results.map { |r| r['id'] }
151
- end
152
- end
153
-
154
- def environment_id(options)
155
- puppet_environment_id(options)
156
- end
157
-
158
- def puppet_environment_id(options)
159
- get_id(:environments, options)
160
- end
161
-
162
- def environment_ids(options)
163
- puppet_environment_ids(options)
164
- end
165
-
166
- def puppet_environment_ids(options)
167
- get_ids(:environments, options)
168
- end
169
-
170
122
  def searchables(resource)
171
123
  resource = @api.resource(resource) if resource.is_a? Symbol
172
124
  @searchables.for(resource)
173
125
  end
174
126
 
127
+ def template_kind_id(options = {})
128
+ name = options['option_type'] == 'snippet' ? nil : options['option_type']
129
+ options['option_name'] = name
130
+ get_id(:template_kinds, options)
131
+ end
132
+
175
133
  protected
176
134
 
177
135
  def define_id_finders
@@ -331,17 +289,6 @@ module HammerCLIForeman
331
289
  0
332
290
  end
333
291
 
334
- # puppet class search results are in non-standard format
335
- # and needs to be un-hashed first
336
- def puppetclass_id(options)
337
- return options[HammerCLI.option_accessor_name("id")] if options[HammerCLI.option_accessor_name("id")]
338
- resource = @api.resource(:puppetclasses)
339
- results = find_resource_raw(:puppetclasses, options)
340
- require('hammer_cli_foreman/puppet_class')
341
- results = HammerCLIForeman::PuppetClass::ListCommand.unhash_classes(results)
342
- pick_result(results, resource)['id']
343
- end
344
-
345
292
  def options_empty?(resource, options)
346
293
  searchables(resource).all? do |s|
347
294
  values = options[HammerCLI.option_accessor_name(s.plural_name.to_s)]
@@ -356,14 +303,6 @@ module HammerCLIForeman
356
303
  end
357
304
  end
358
305
 
359
- def create_smart_class_parameters_search_options(options, mode = nil)
360
- search_options = {}
361
- value = options[HammerCLI.option_accessor_name('name')]
362
- search_options[:search] = "key = \"#{value}\""
363
- search_options[:puppetclass_id] = puppetclass_id(scoped_options("puppetclass", options))
364
- search_options
365
- end
366
-
367
306
  # @param mode [Symbol] mode in which ids are searched :single, :multi, nil for old beahvior
368
307
  def create_search_options(options, resource, mode = nil)
369
308
  searchables(resource).each do |s|
@@ -36,7 +36,6 @@ module HammerCLIForeman
36
36
  HammerCLIForeman::References.partition_tables(self)
37
37
  HammerCLIForeman::References.domains(self)
38
38
  HammerCLIForeman::References.realms(self)
39
- HammerCLIForeman::References.environments(self)
40
39
  HammerCLIForeman::References.hostgroups(self)
41
40
  HammerCLIForeman::References.parameters(self)
42
41
  collection :organizations, _("Organizations"), :numbered => false, :hide_blank => true do
@@ -58,8 +57,6 @@ module HammerCLIForeman
58
57
  failure_message _("Could not create the location")
59
58
 
60
59
  build_options
61
-
62
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironments.new)
63
60
  end
64
61
 
65
62
 
@@ -72,8 +69,6 @@ module HammerCLIForeman
72
69
  failure_message _("Could not update the location")
73
70
 
74
71
  build_options
75
-
76
- extend_with(HammerCLIForeman::CommandExtensions::PuppetEnvironments.new)
77
72
  end
78
73
 
79
74
 
@@ -112,7 +107,6 @@ module HammerCLIForeman
112
107
  end
113
108
 
114
109
  HammerCLIForeman::AssociatingCommands::Hostgroup.extend_command(self)
115
- HammerCLIForeman::AssociatingCommands::PuppetEnvironment.extend_command(self)
116
110
  HammerCLIForeman::AssociatingCommands::Domain.extend_command(self)
117
111
  HammerCLIForeman::AssociatingCommands::Medium.extend_command(self)
118
112
  HammerCLIForeman::AssociatingCommands::Subnet.extend_command(self)
@@ -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
  class InfoCommand < HammerCLIForeman::InfoCommand
@@ -22,7 +22,7 @@ module HammerCLIForeman
22
22
  field :subscription_type, _("Subscription type")
23
23
  end
24
24
 
25
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
25
+ build_options
26
26
  end
27
27
 
28
28
  autoload_subcommands
@@ -13,7 +13,7 @@ module HammerCLIForeman
13
13
  field :hardware_model, _("HW model")
14
14
  end
15
15
 
16
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
16
+ build_options
17
17
  end
18
18
 
19
19
 
@@ -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,14 +31,14 @@ module HammerCLIForeman
31
31
  success_message _("Hardware model created.")
32
32
  failure_message _("Could not create the hardware model")
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
  class DeleteCommand < HammerCLIForeman::DeleteCommand
38
38
  success_message _("Hardware model deleted.")
39
39
  failure_message _("Could not delete the hardware model")
40
40
 
41
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
41
+ build_options
42
42
  end
43
43
 
44
44
 
@@ -46,7 +46,7 @@ module HammerCLIForeman
46
46
  success_message _("Hardware model updated.")
47
47
  failure_message _("Could not update the hardware model")
48
48
 
49
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
49
+ build_options
50
50
  end
51
51
 
52
52
 
@@ -13,7 +13,7 @@ module HammerCLIForeman
13
13
  field :family, _("Family")
14
14
  end
15
15
 
16
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
16
+ build_options
17
17
  end
18
18
 
19
19
 
@@ -36,7 +36,7 @@ module HammerCLIForeman
36
36
  HammerCLIForeman::References.parameters(self)
37
37
  end
38
38
 
39
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
39
+ build_options
40
40
  end
41
41
 
42
42
 
@@ -44,7 +44,7 @@ module HammerCLIForeman
44
44
  success_message _("Operating system created.")
45
45
  failure_message _("Could not create the operating system")
46
46
 
47
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
47
+ build_options
48
48
  end
49
49
 
50
50
 
@@ -52,7 +52,7 @@ module HammerCLIForeman
52
52
  success_message _("Operating system updated.")
53
53
  failure_message _("Could not update the operating system")
54
54
 
55
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
55
+ build_options
56
56
  end
57
57
 
58
58
 
@@ -60,7 +60,7 @@ module HammerCLIForeman
60
60
  success_message _("Operating system deleted.")
61
61
  failure_message _("Could not delete the operating system")
62
62
 
63
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
63
+ build_options
64
64
  end
65
65
 
66
66
 
@@ -76,7 +76,7 @@ module HammerCLIForeman
76
76
  validator.any(:option_operatingsystem_id, :option_operatingsystem_title).required
77
77
  end
78
78
 
79
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
79
+ build_options
80
80
  end
81
81
 
82
82
 
@@ -90,7 +90,7 @@ module HammerCLIForeman
90
90
  validator.any(:option_operatingsystem_id, :option_operatingsystem_title).required
91
91
  end
92
92
 
93
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
93
+ build_options
94
94
  end
95
95
 
96
96
 
@@ -156,8 +156,8 @@ module HammerCLIForeman
156
156
  HammerCLI::EX_OK
157
157
  end
158
158
 
159
- build_options expand: { except: %i[organizations locations] },
160
- without: %i[organization_id location_id template_kind_id type]
159
+ build_options without: [:template_kind_id, :type]
160
+
161
161
  end
162
162
 
163
163
 
@@ -192,7 +192,7 @@ module HammerCLIForeman
192
192
  {"operatingsystem_id" => option_id}
193
193
  end
194
194
 
195
- build_options expand: { except: %i[organizations locations] }, without: %i[organization_id location_id]
195
+ build_options
196
196
  end
197
197
 
198
198