hammer_cli_katello 0.18.0 → 0.18.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54e72239ee798a8de0f21c8590e82f8bec7b7afa6226a7fca79fa86eb98cac93
4
- data.tar.gz: 7422feeb5d60c975d7588bbf85b33893f48b05811f11b462c4999fb50fc818d8
3
+ metadata.gz: 8033d757d1cbf46a42a4db8c40162c286da7014d9fd3daf40b9b77b50ca6af89
4
+ data.tar.gz: 6df9fec9fffb51a289ed0feda318fca4886c854e81cd4ac73b712dde710cec6c
5
5
  SHA512:
6
- metadata.gz: 9977229efb0e161dddda02cd32b59a0721b2165b6f63c16438ad722782d9d9b68d733a21a9ac50c9c39f962c2e35dbac866a6bbd812d48ff9eea6324b9da36f5
7
- data.tar.gz: 3dc3a3c27f3574dd96a2136d227456717a43b3e2695e55e58b54e7f37ae1c7f3acf7386b632be94be2c3a3e4cf1a1d5cab0f35636f57c071507450d1fa515803
6
+ metadata.gz: e8fefa39c3064b3b1b8a6f36957a853cb44ec62d052d3582a8c2aebf26ce145c03f71b36795f3f8a2fae6e4bbd602252a470fdcbf53e191d0b3904e44f36528b
7
+ data.tar.gz: 0f4189c196c37c55a3bb7829e23e9cace800c970a8bc482628001bbe18ce77399f5ecd8085c23fd66dc96290fb34d6af286321a9b7a7357f32f730c36210217b
@@ -7,7 +7,7 @@ module HammerCLIKatello
7
7
 
8
8
  class ListCommand < HammerCLIKatello::ListCommand
9
9
  include LifecycleEnvironmentNameMapping
10
- include LifecycleEnvironmentNameResolvable
10
+
11
11
  action :index
12
12
 
13
13
  output do
@@ -34,11 +34,11 @@ module HammerCLIKatello
34
34
  end
35
35
 
36
36
  build_options
37
+
38
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
37
39
  end
38
40
 
39
41
  class InfoCommand < HammerCLIKatello::InfoCommand
40
- include LifecycleEnvironmentNameMapping
41
- include LifecycleEnvironmentNameResolvable
42
42
  action :show
43
43
 
44
44
  def request_params
@@ -83,7 +83,7 @@ module HammerCLIKatello
83
83
 
84
84
  class CreateCommand < HammerCLIKatello::CreateCommand
85
85
  include LifecycleEnvironmentNameMapping
86
- include LifecycleEnvironmentNameResolvable
86
+
87
87
  action :create
88
88
  success_message _("Activation key created.")
89
89
  failure_message _("Could not create the activation key")
@@ -95,11 +95,11 @@ module HammerCLIKatello
95
95
  end
96
96
 
97
97
  build_options
98
+
99
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
98
100
  end
99
101
 
100
102
  class CopyCommand < HammerCLIKatello::CreateCommand
101
- include LifecycleEnvironmentNameMapping
102
- include LifecycleEnvironmentNameResolvable
103
103
  action :copy
104
104
 
105
105
  desc _("Copy an activation key")
@@ -113,7 +113,7 @@ module HammerCLIKatello
113
113
 
114
114
  class UpdateCommand < HammerCLIKatello::UpdateCommand
115
115
  include LifecycleEnvironmentNameMapping
116
- include LifecycleEnvironmentNameResolvable
116
+
117
117
  action :update
118
118
  success_message _("Activation key updated.")
119
119
  failure_message _("Could not update the activation key")
@@ -125,11 +125,11 @@ module HammerCLIKatello
125
125
  end
126
126
 
127
127
  build_options
128
+
129
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
128
130
  end
129
131
 
130
132
  class DeleteCommand < HammerCLIKatello::DeleteCommand
131
- include LifecycleEnvironmentNameMapping
132
- include LifecycleEnvironmentNameResolvable
133
133
  action :destroy
134
134
  success_message _("Activation key deleted.")
135
135
  failure_message _("Could not delete the activation key")
@@ -39,7 +39,8 @@ module HammerCLIKatello
39
39
  end
40
40
 
41
41
  class AddLifecycleEnvironmentCommand < HammerCLIKatello::Command
42
- include LifecycleEnvironmentNameResolvable
42
+ include LifecycleEnvironmentNameMapping
43
+
43
44
  resource :capsule_content, :add_lifecycle_environment
44
45
  command_name 'add-lifecycle-environment'
45
46
 
@@ -51,10 +52,13 @@ module HammerCLIKatello
51
52
  option "--organization", "NAME", _("Organization name"),
52
53
  :attribute_name => :option_organization_name
53
54
  build_options
55
+
56
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
54
57
  end
55
58
 
56
59
  class RemoveLifecycleEnvironmentCommand < HammerCLIKatello::Command
57
- include LifecycleEnvironmentNameResolvable
60
+ include LifecycleEnvironmentNameMapping
61
+
58
62
  resource :capsule_content, :remove_lifecycle_environment
59
63
  command_name 'remove-lifecycle-environment'
60
64
 
@@ -66,11 +70,14 @@ module HammerCLIKatello
66
70
  option "--organization", "NAME", _("Organization name"),
67
71
  :attribute_name => :option_organization_name
68
72
  build_options
73
+
74
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
69
75
  end
70
76
 
71
77
  class SyncCommand < HammerCLIKatello::SingleResourceCommand
72
78
  include HammerCLIForemanTasks::Async
73
- include LifecycleEnvironmentNameResolvable
79
+ include LifecycleEnvironmentNameMapping
80
+
74
81
  resource :capsule_content, :sync
75
82
  command_name "synchronize"
76
83
 
@@ -82,6 +89,8 @@ module HammerCLIKatello
82
89
  option "--organization", "NAME", _("Organization name"),
83
90
  :attribute_name => :option_organization_name
84
91
  build_options
92
+
93
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
85
94
  end
86
95
 
87
96
  class SyncStatusCommand < HammerCLIKatello::InfoCommand
@@ -0,0 +1,23 @@
1
+ module HammerCLIKatello
2
+ module CommandExtensions
3
+ class LifecycleEnvironment < HammerCLI::CommandExtensions
4
+ # Remove when support of --environment options is ended.
5
+ option '--environment', 'ENVIRONMENT_NAME', _('Lifecycle environment name to search by'),
6
+ attribute_name: :option_environment_name,
7
+ deprecated: { '--environment' => _('Use --lifecycle-environment instead') }
8
+ option '--environment-id', 'ENVIRONMENT_ID', _(''),
9
+ format: HammerCLI::Options::Normalizers::Number.new,
10
+ attribute_name: :option_environment_id,
11
+ deprecated: { '--environment-id' => _('Use --lifecycle-environment-id instead') }
12
+
13
+ option_sources do |sources, command|
14
+ sources.find_by_name('IdResolution').insert_relative(
15
+ :after,
16
+ 'IdParams',
17
+ HammerCLIKatello::OptionSources::LifecycleEnvironmentParams.new(command)
18
+ )
19
+ sources
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,24 @@
1
+ module HammerCLIKatello
2
+ module CommandExtensions
3
+ class LifecycleEnvironments < HammerCLI::CommandExtensions
4
+ # Remove when support of --environments options is ended.
5
+ option '--environments', 'ENVIRONMENT_NAMES', _(''),
6
+ format: HammerCLI::Options::Normalizers::List.new,
7
+ attribute_name: :option_environment_names,
8
+ deprecated: { '--environments' => _('Use --lifecycle-environments instead') }
9
+ option '--environment-ids', 'ENVIRONMENT_IDS', _(''),
10
+ format: HammerCLI::Options::Normalizers::List.new,
11
+ attribute_name: :option_environment_ids,
12
+ deprecated: { '--environment-ids' => _('Use --lifecycle-environment-ids instead') }
13
+
14
+ option_sources do |sources, command|
15
+ sources.find_by_name('IdResolution').insert_relative(
16
+ :after,
17
+ 'IdsParams',
18
+ HammerCLIKatello::OptionSources::LifecycleEnvironmentParams.new(command)
19
+ )
20
+ sources
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'hammer_cli_katello/command_extensions/lifecycle_environment'
4
+ require 'hammer_cli_katello/command_extensions/lifecycle_environments'
@@ -1,6 +1,11 @@
1
1
  module HammerCLIKatello
2
2
  RESOURCE_NAME_MAPPING = {}.freeze
3
3
 
4
+ RESOURCE_ALIAS_NAME_MAPPING = {
5
+ environment: :lifecycle_environment,
6
+ environments: :lifecycle_environments
7
+ }.freeze
8
+
4
9
  def self.api_connection
5
10
  if HammerCLI.context[:api_connection]
6
11
  HammerCLI.context[:api_connection].get("foreman")
@@ -10,7 +10,7 @@ module HammerCLIKatello
10
10
 
11
11
  class ListCommand < HammerCLIKatello::ListCommand
12
12
  include LifecycleEnvironmentNameMapping
13
- include LifecycleEnvironmentNameResolvable
13
+
14
14
  output do
15
15
  field :id, _("Content View ID")
16
16
  field :name, _("Name")
@@ -21,6 +21,8 @@ module HammerCLIKatello
21
21
  end
22
22
 
23
23
  build_options
24
+
25
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
24
26
  end
25
27
 
26
28
  class InfoCommand < HammerCLIKatello::InfoCommand
@@ -226,7 +228,6 @@ module HammerCLIKatello
226
228
 
227
229
  class RemoveFromEnvironmentCommand < HammerCLIKatello::SingleResourceCommand
228
230
  include LifecycleEnvironmentNameMapping
229
- include LifecycleEnvironmentNameResolvable
230
231
  include HammerCLIForemanTasks::Async
231
232
  include OrganizationOptions
232
233
 
@@ -237,6 +238,8 @@ module HammerCLIKatello
237
238
  failure_message _("Could not remove the content view from environment")
238
239
 
239
240
  build_options
241
+
242
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
240
243
  end
241
244
 
242
245
  class CVEnvParamsSource < HammerCLI::Options::Sources::Base
@@ -254,6 +257,7 @@ module HammerCLIKatello
254
257
  class RemoveCommand < HammerCLIKatello::SingleResourceCommand
255
258
  include HammerCLIForemanTasks::Async
256
259
  include OrganizationOptions
260
+ include LifecycleEnvironmentNameMapping
257
261
 
258
262
  # command to remove content view environments and versions from a content view.
259
263
  # corresponds to the UI screen.
@@ -263,7 +267,7 @@ module HammerCLIKatello
263
267
  option ["--content-view-version-ids"], "VERSION_IDS",
264
268
  _("Version ids to remove"),
265
269
  :format => HammerCLI::Options::Normalizers::List.new
266
- option ["--environment-ids"], "ENVIRONMENT_IDS",
270
+ option ["--lifecycle-environment-ids"], "LIFECYCLE_ENVIRONMENT_IDS",
267
271
  _("Environment ids to remove"),
268
272
  :format => HammerCLI::Options::Normalizers::List.new
269
273
 
@@ -289,6 +293,8 @@ module HammerCLIKatello
289
293
  failure_message _("Could not remove objects from content view")
290
294
 
291
295
  build_options
296
+
297
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironments.new)
292
298
  end
293
299
 
294
300
  class AddContentViewVersionCommand < HammerCLIKatello::AddAssociatedCommand
@@ -7,6 +7,8 @@ module HammerCLIKatello
7
7
  desc 'View and manage content view versions'
8
8
 
9
9
  class ListCommand < HammerCLIKatello::ListCommand
10
+ include LifecycleEnvironmentNameMapping
11
+
10
12
  output do
11
13
  field :id, _("ID")
12
14
  field :name, _("Name")
@@ -22,9 +24,13 @@ module HammerCLIKatello
22
24
  build_options do |o|
23
25
  o.expand(:all).including(:organizations)
24
26
  end
27
+
28
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
25
29
  end
26
30
 
27
31
  class InfoCommand < HammerCLIKatello::InfoCommand
32
+ include LifecycleEnvironmentNameMapping
33
+
28
34
  resource :content_view_versions, :show
29
35
 
30
36
  output do
@@ -62,6 +68,8 @@ module HammerCLIKatello
62
68
  build_options do |o|
63
69
  o.expand(:all).including(:environments, :content_views, :organizations)
64
70
  end
71
+
72
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
65
73
  end
66
74
 
67
75
  class RepublishRepositoriesCommand < HammerCLIKatello::SingleResourceCommand
@@ -79,6 +87,7 @@ module HammerCLIKatello
79
87
 
80
88
  class PromoteCommand < HammerCLIKatello::SingleResourceCommand
81
89
  include HammerCLIForemanTasks::Async
90
+ include LifecycleEnvironmentNameMapping
82
91
 
83
92
  action :promote
84
93
  command_name "promote"
@@ -101,6 +110,10 @@ module HammerCLIKatello
101
110
  _(["Id of the environment from where to promote its version ",
102
111
  "from (if version is unknown)"].join),
103
112
  :attribute_name => :option_from_environment_id
113
+ option "--environment-ids", "ENVIRONMENT_IDS", _("Identifiers for Lifecycle Environment"),
114
+ format: HammerCLI::Options::Normalizers::List.new,
115
+ attribute_name: :option_environment_ids,
116
+ deprecated: { '--environment-ids' => _('Use --lifecycle-environment-ids instead') }
104
117
 
105
118
  def environment_search_options
106
119
  {
@@ -123,10 +136,15 @@ module HammerCLIKatello
123
136
  o.expand(:all).except(:environments).including(:content_views, :organizations)
124
137
  o.without(:environment_id)
125
138
  end
139
+
140
+ extend_with(
141
+ HammerCLIKatello::CommandExtensions::LifecycleEnvironments.new(only: :option_sources)
142
+ )
126
143
  end
127
144
 
128
145
  class DeleteCommand < HammerCLIKatello::DeleteCommand
129
146
  include HammerCLIForemanTasks::Async
147
+ include LifecycleEnvironmentNameMapping
130
148
 
131
149
  action :destroy
132
150
  command_name "delete"
@@ -137,6 +155,8 @@ module HammerCLIKatello
137
155
  build_options do |o|
138
156
  o.expand(:all).including(:environments, :content_views, :organizations)
139
157
  end
158
+
159
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
140
160
  end
141
161
 
142
162
  class IncrementalUpdate < HammerCLIKatello::Command
@@ -249,6 +269,7 @@ module HammerCLIKatello
249
269
 
250
270
  class LegacyExportCommand < HammerCLIKatello::SingleResourceCommand
251
271
  include HammerCLIForemanTasks::Async
272
+ include LifecycleEnvironmentNameMapping
252
273
  desc _('Export a content view (deprecated)')
253
274
 
254
275
  action :export
@@ -260,6 +281,8 @@ module HammerCLIKatello
260
281
  build_options do |o|
261
282
  o.expand(:all).including(:environments, :content_views, :organizations)
262
283
  end
284
+
285
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
263
286
  end
264
287
 
265
288
  class ExportCommand < HammerCLIForeman::Command
@@ -45,7 +45,9 @@ module HammerCLIKatello
45
45
 
46
46
  def check_repo_download_policy(repositories)
47
47
  non_immediate = repositories.select do |repo|
48
- show(:repositories, 'id' => repo['library_instance_id'])['download_policy'] != 'immediate'
48
+ unless repo['library_instance_id'].nil?
49
+ show(:repositories, 'id' => repo['library_instance_id'])['download_policy'] != 'immediate'
50
+ end
49
51
  end
50
52
  unless non_immediate.empty?
51
53
  non_immediate_names = repositories.collect { |repo| repo['name'] }
@@ -5,19 +5,16 @@ require 'hammer_cli_katello/host_package'
5
5
  require 'hammer_cli_katello/host_package_group'
6
6
  require 'hammer_cli_katello/host_kickstart_repository_options'
7
7
  require 'hammer_cli_katello/host_content_source_options'
8
- require 'hammer_cli_katello/puppet_environment_name_resolvable'
9
8
 
10
9
  module HammerCLIKatello
11
10
  module HostExtensions
12
11
  ::HammerCLIForeman::Host::CreateCommand.instance_eval do
13
- include HammerCLIKatello::PuppetEnvironmentNameResolvable
14
12
  include HammerCLIKatello::ResolverCommons
15
13
  include HammerCLIKatello::HostContentSourceOptions
16
14
  include ::HammerCLIKatello::HostKickstartRepositoryOptions
17
15
  end
18
16
 
19
17
  ::HammerCLIForeman::Host::UpdateCommand.instance_eval do
20
- include HammerCLIKatello::PuppetEnvironmentNameResolvable
21
18
  include HammerCLIKatello::ResolverCommons
22
19
  include HammerCLIKatello::HostContentSourceOptions
23
20
  include ::HammerCLIKatello::HostKickstartRepositoryOptions
@@ -16,7 +16,7 @@ module HammerCLIKatello
16
16
  end
17
17
 
18
18
  class CreateCommand < HammerCLIKatello::SingleResourceCommand
19
- include LifecycleEnvironmentNameResolvable
19
+ include LifecycleEnvironmentNameMapping
20
20
  include OrganizationOptions
21
21
 
22
22
  resource :host_subscriptions, :create
@@ -28,6 +28,8 @@ module HammerCLIKatello
28
28
  o.expand(:all).except(:products)
29
29
  o.without(:facts, :installed_products)
30
30
  end
31
+
32
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
31
33
  end
32
34
 
33
35
  class AddSubscriptions < HammerCLIKatello::SingleResourceCommand
@@ -1,5 +1,4 @@
1
1
  require 'hammer_cli_foreman/hostgroup'
2
- require 'hammer_cli_katello/puppet_environment_name_resolvable'
3
2
  require 'hammer_cli_katello/host_kickstart_repository_options'
4
3
  require 'hammer_cli_katello/host_content_source_options'
5
4
 
@@ -29,7 +28,6 @@ module HammerCLIKatello
29
28
  module HostgroupExtensions
30
29
  ::HammerCLIForeman::Hostgroup::CreateCommand.instance_eval do
31
30
  include HammerCLIKatello::ResolverCommons
32
- include HammerCLIKatello::PuppetEnvironmentNameResolvable
33
31
  include HammerCLIKatello::ContentViewNameResolvable
34
32
  include HammerCLIKatello::QueryOrganizationOptions
35
33
  include HammerCLIKatello::HostContentSourceOptions
@@ -38,7 +36,6 @@ module HammerCLIKatello
38
36
 
39
37
  ::HammerCLIForeman::Hostgroup::UpdateCommand.instance_eval do
40
38
  include HammerCLIKatello::ResolverCommons
41
- include HammerCLIKatello::PuppetEnvironmentNameResolvable
42
39
  include HammerCLIKatello::ContentViewNameResolvable
43
40
  include HammerCLIKatello::QueryOrganizationOptions
44
41
  include HammerCLIKatello::HostContentSourceOptions
@@ -14,6 +14,7 @@ module HammerCLIKatello
14
14
  s("repository_id", _("Repository ID"))],
15
15
  :gpg => [s_name(_("Gpg key name to search by"))],
16
16
  :host_collection => [s_name(_("Host collection name to search by"))],
17
+ :environment => [s_name(_("Lifecycle environment name to search by"))],
17
18
  :lifecycle_environment => [s_name(_("Lifecycle environment name to search by"))],
18
19
  :organization => [s_name(_("Organization name to search by")),
19
20
  s("label", _("Organization label to search by"),
@@ -62,14 +63,14 @@ module HammerCLIKatello
62
63
  smart_proxy_id(options)
63
64
  end
64
65
 
65
- def puppet_environment_id(options)
66
- get_id(:environments, options)
67
- end
68
-
69
66
  def environment_id(options)
70
67
  lifecycle_environment_id(options)
71
68
  end
72
69
 
70
+ def lifecycle_environment_ids(options)
71
+ environment_ids(options)
72
+ end
73
+
73
74
  def environment_ids(options)
74
75
  unless options['option_lifecycle_environment_ids'].nil?
75
76
  return options['option_lifecycle_environment_ids']
@@ -8,8 +8,13 @@ module HammerCLIKatello
8
8
  def resource_name_mapping
9
9
  mapping = Command.resource_name_mapping
10
10
  mapping[:environment] = :lifecycle_environment
11
+ mapping[:environments] = :lifecycle_environments
11
12
  mapping
12
13
  end
14
+
15
+ def resource_alias_name_mapping
16
+ HammerCLIKatello::RESOURCE_ALIAS_NAME_MAPPING
17
+ end
13
18
  end
14
19
  end
15
20
  end
@@ -1,6 +1,6 @@
1
1
  module HammerCLIKatello
2
- module LifecycleEnvironmentNameResolvable
3
- class LifecycleEnvironmentParamSource < HammerCLI::Options::Sources::Base
2
+ module OptionSources
3
+ class LifecycleEnvironmentParams < HammerCLI::Options::Sources::Base
4
4
  def initialize(command)
5
5
  @command = command
6
6
  end
@@ -10,18 +10,12 @@ module HammerCLIKatello
10
10
  result['option_environment_id'] = @command.resolver.lifecycle_environment_id(
11
11
  @command.resolver.scoped_options('environment', result, :single))
12
12
  end
13
+ if result['option_environment_names'] && result['option_environment_ids'].nil?
14
+ result['option_environment_ids'] = @command.resolver.lifecycle_environment_ids(
15
+ @command.resolver.scoped_options('environment', result, :multi))
16
+ end
13
17
  result
14
18
  end
15
19
  end
16
-
17
- def option_sources
18
- sources = super
19
- sources.find_by_name('IdResolution').insert_relative(
20
- :after,
21
- 'IdParams',
22
- LifecycleEnvironmentParamSource.new(self)
23
- )
24
- sources
25
- end
26
20
  end
27
21
  end
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'hammer_cli_katello/option_sources/lifecycle_environment_params'
@@ -3,6 +3,8 @@ module HammerCLIKatello
3
3
  resource :repositories
4
4
 
5
5
  class ListCommand < HammerCLIKatello::ListCommand
6
+ include LifecycleEnvironmentNameMapping
7
+
6
8
  output do
7
9
  field :id, _("Id")
8
10
  field :name, _("Name")
@@ -14,6 +16,8 @@ module HammerCLIKatello
14
16
  end
15
17
 
16
18
  build_options
19
+
20
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
17
21
  end
18
22
 
19
23
  # rubocop:disable ClassLength
@@ -1,5 +1,5 @@
1
1
  module HammerCLIKatello
2
2
  def self.version
3
- @version ||= Gem::Version.new('0.18.0')
3
+ @version ||= Gem::Version.new('0.18.2')
4
4
  end
5
5
  end
@@ -14,7 +14,8 @@ module HammerCLIKatello
14
14
  require 'hammer_cli_katello/output/fields'
15
15
  require 'hammer_cli_katello/output/formatters'
16
16
  require 'hammer_cli_katello/lifecycle_environment_name_mapping'
17
- require 'hammer_cli_katello/lifecycle_environment_name_resolvable'
17
+ require 'hammer_cli_katello/option_sources'
18
+ require 'hammer_cli_katello/command_extensions'
18
19
  require 'hammer_cli_katello/content_view_name_resolvable'
19
20
  require 'hammer_cli_katello/composite_content_view_name_resolvable'
20
21
  require 'hammer_cli_katello/organization_options'
@@ -59,10 +59,10 @@ ID | NAME | PRODUCT | CONTENT TYPE | URL
59
59
 
60
60
  ex.returns(empty_response)
61
61
 
62
- expected_result = success_result("---|------|---------|--------------|----
62
+ expected_result = CommandExpectation.new("---|------|---------|--------------|----
63
63
  ID | NAME | PRODUCT | CONTENT TYPE | URL
64
64
  ---|------|---------|--------------|----
65
- ")
65
+ ", "Warning: Option --environment is deprecated. Use --lifecycle-environment instead\n")
66
66
 
67
67
  result = run_cmd(@cmd + params)
68
68
  assert_cmd(expected_result, result)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hammer_cli_katello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.0
4
+ version: 0.18.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Price
@@ -34,7 +34,7 @@ authors:
34
34
  autorequire:
35
35
  bindir: bin
36
36
  cert_chain: []
37
- date: 2019-05-03 00:00:00.000000000 Z
37
+ date: 2019-07-25 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: hammer_cli_foreman
@@ -232,6 +232,9 @@ files:
232
232
  - lib/hammer_cli_katello/apipie_helper.rb
233
233
  - lib/hammer_cli_katello/associating_commands.rb
234
234
  - lib/hammer_cli_katello/capsule.rb
235
+ - lib/hammer_cli_katello/command_extensions.rb
236
+ - lib/hammer_cli_katello/command_extensions/lifecycle_environment.rb
237
+ - lib/hammer_cli_katello/command_extensions/lifecycle_environments.rb
235
238
  - lib/hammer_cli_katello/commands.rb
236
239
  - lib/hammer_cli_katello/composite_content_view_name_resolvable.rb
237
240
  - lib/hammer_cli_katello/content_override.rb
@@ -269,10 +272,11 @@ files:
269
272
  - lib/hammer_cli_katello/id_resolver.rb
270
273
  - lib/hammer_cli_katello/lifecycle_environment.rb
271
274
  - lib/hammer_cli_katello/lifecycle_environment_name_mapping.rb
272
- - lib/hammer_cli_katello/lifecycle_environment_name_resolvable.rb
273
275
  - lib/hammer_cli_katello/local_helper.rb
274
276
  - lib/hammer_cli_katello/module_stream.rb
275
277
  - lib/hammer_cli_katello/module_stream_profile.rb
278
+ - lib/hammer_cli_katello/option_sources.rb
279
+ - lib/hammer_cli_katello/option_sources/lifecycle_environment_params.rb
276
280
  - lib/hammer_cli_katello/organization.rb
277
281
  - lib/hammer_cli_katello/organization_options.rb
278
282
  - lib/hammer_cli_katello/ostree_branch.rb
@@ -283,7 +287,6 @@ files:
283
287
  - lib/hammer_cli_katello/ping.rb
284
288
  - lib/hammer_cli_katello/product.rb
285
289
  - lib/hammer_cli_katello/product_content.rb
286
- - lib/hammer_cli_katello/puppet_environment_name_resolvable.rb
287
290
  - lib/hammer_cli_katello/puppet_module.rb
288
291
  - lib/hammer_cli_katello/repository.rb
289
292
  - lib/hammer_cli_katello/repository_scoped_to_product.rb
@@ -486,7 +489,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
486
489
  - !ruby/object:Gem::Version
487
490
  version: '0'
488
491
  requirements: []
489
- rubygems_version: 3.0.2
492
+ rubyforge_project:
493
+ rubygems_version: 2.7.6.2
490
494
  signing_key:
491
495
  specification_version: 4
492
496
  summary: Katello commands for Hammer
@@ -1,27 +0,0 @@
1
- module HammerCLIKatello
2
- module PuppetEnvironmentNameResolvable
3
- class PuppetEnvParamSource < 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? && result['option_environment_name']
10
- result['option_environment_id'] = @command.resolver.puppet_environment_id(
11
- @command.resolver.scoped_options('environment', result, :single))
12
- end
13
- result
14
- end
15
- end
16
-
17
- def option_sources
18
- sources = super
19
- sources.find_by_name('IdResolution').insert_relative(
20
- :after,
21
- 'IdParams',
22
- PuppetEnvParamSource.new(self)
23
- )
24
- sources
25
- end
26
- end
27
- end