hammer_cli_katello 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hammer_cli_katello/command_extensions/content_source.rb +32 -0
  3. data/lib/hammer_cli_katello/command_extensions/kickstart_repository.rb +50 -0
  4. data/lib/hammer_cli_katello/command_extensions/lifecycle_environment.rb +12 -0
  5. data/lib/hammer_cli_katello/command_extensions.rb +2 -0
  6. data/lib/hammer_cli_katello/commands.rb +1 -1
  7. data/lib/hammer_cli_katello/content_export_helper.rb +6 -2
  8. data/lib/hammer_cli_katello/content_view.rb +11 -0
  9. data/lib/hammer_cli_katello/content_view_version.rb +3 -3
  10. data/lib/hammer_cli_katello/host_errata.rb +1 -2
  11. data/lib/hammer_cli_katello/host_extensions.rb +8 -6
  12. data/lib/hammer_cli_katello/hostgroup_extensions.rb +19 -12
  13. data/lib/hammer_cli_katello/id_resolver.rb +5 -2
  14. data/lib/hammer_cli_katello/option_sources/lifecycle_environment_params.rb +40 -3
  15. data/lib/hammer_cli_katello/organization.rb +28 -3
  16. data/lib/hammer_cli_katello/package.rb +2 -1
  17. data/lib/hammer_cli_katello/ping.rb +7 -0
  18. data/lib/hammer_cli_katello/repository.rb +10 -4
  19. data/lib/hammer_cli_katello/search_options_creators.rb +2 -1
  20. data/lib/hammer_cli_katello/srpm.rb +2 -0
  21. data/lib/hammer_cli_katello/version.rb +1 -1
  22. data/test/data/4.3/foreman_api.json +1 -0
  23. data/test/functional/activation_key/create_test.rb +1 -1
  24. data/test/functional/activation_key/subscriptions_test.rb +1 -1
  25. data/test/functional/content_view/version/promote_test.rb +41 -0
  26. data/test/functional/content_view/version/republish_repositories_test.rb +1 -1
  27. data/test/functional/host/errata/recalculate_test.rb +8 -22
  28. data/test/functional/module_stream/info_test.rb +1 -1
  29. data/test/functional/organization/cdn_configuration_test.rb +42 -0
  30. data/test/functional/organization/info_test.rb +17 -0
  31. data/test/functional/package/list_test.rb +4 -2
  32. data/test/functional/ping_test.rb +3 -1
  33. data/test/functional/srpm/list_test.rb +1 -1
  34. data/test/functional/subscription/list_test.rb +2 -2
  35. data/test/test_helper.rb +1 -1
  36. metadata +11 -7
  37. data/lib/hammer_cli_katello/host_content_source_options.rb +0 -28
  38. data/lib/hammer_cli_katello/host_kickstart_repository_options.rb +0 -49
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ec840ea7e9516ce7268b7d2ddce6bebce2a4b4a71ac4963c475fc472a6e5dab
4
- data.tar.gz: 2388188ed12e64cc36d20192ccd1d70c2e53547efef35a5f40b02d1a190fcb77
3
+ metadata.gz: 70bd64a3e1a162fa1c50c097a5f6c60cff91f6764a91aa715f575387bc02406c
4
+ data.tar.gz: 9b75290d2868faa302f15f23022bf310ca7f091ec819da5eba988abb17adda4d
5
5
  SHA512:
6
- metadata.gz: 190ede71c0bb873d5ded32b884de84137da2a367d987f055505fcfde3995a3419fd1e5c919630569b18266bba2efd5c5a496b471803de659f63dd547299c67e1
7
- data.tar.gz: 3f96f683fb9a0ab6f0f92c6451aa528dd6929c6a16172dd1a4dfbfc63c7dcb6f1d7b2b0f49dc1fff72f039a08aaa5374d31d122a7222e053d985c78755f44e97
6
+ metadata.gz: 0b5ab6e3272b3336bb11ca0b0e200fab63654f90bdafc5c213807fb9928da84e377132a408f826a58b8b58d2d55d9fa5f8b142284ff8f0f310b74b72cfd18ec7
7
+ data.tar.gz: a114e7f127f3418cadf0a7f9e06a728a6837013eac2245fe4ca49836441486cb7599146a027f22559376fa0ecaf3f44ecd1a5a587f97a9bc0e19b44e62bc8465
@@ -0,0 +1,32 @@
1
+ module HammerCLIKatello
2
+ module CommandExtensions
3
+ class ContentSource < HammerCLI::CommandExtensions
4
+ option_family associate: 'content_source' do
5
+ child '--content-source', 'CONTENT_SOURCE_NAME', _('Content Source name'),
6
+ attribute_name: :option_content_source,
7
+ referenced_resource: :smart_proxy
8
+ end
9
+
10
+ request_params do |params, cmd_obj|
11
+ begin
12
+ resource_name = cmd_obj.resource.singular_name
13
+ if cmd_obj.option_content_source && !cmd_obj.option_content_source_id
14
+ resource_hash = if resource_name == 'hostgroup'
15
+ params[resource_name]
16
+ else
17
+ params[resource_name]['content_facet_attributes']
18
+ end
19
+
20
+ proxy_options = {
21
+ HammerCLI.option_accessor_name('name') => cmd_obj.option_content_source
22
+ }
23
+ resource_hash['content_source_id'] = cmd_obj.resolver.smart_proxy_id(proxy_options)
24
+ end
25
+ rescue HammerCLIForeman::ResolverError => e
26
+ e.message.gsub!('smart_proxy', _('Content Source'))
27
+ raise e
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,50 @@
1
+ module HammerCLIKatello
2
+ module CommandExtensions
3
+ class KickstartRepository < HammerCLI::CommandExtensions
4
+ option_family associate: 'kickstart_repository' do
5
+ child '--kickstart-repository', 'REPOSITORY_NAME', _('Kickstart repository name'),
6
+ attribute_name: :option_kickstart_repository
7
+ end
8
+
9
+ request_params do |params, cmd_obj|
10
+ resource_name = cmd_obj.resource.singular_name
11
+ if cmd_obj.option_kickstart_repository && !cmd_obj.option_kickstart_repository_id
12
+ resource_hash = if resource_name == 'hostgroup'
13
+ params[resource_name]
14
+ else
15
+ params[resource_name]['content_facet_attributes']
16
+ end
17
+
18
+ resource_hash ||= {}
19
+
20
+ env_id = resource_hash['lifecycle_environment_id']
21
+ cv_id = resource_hash['content_view_id']
22
+
23
+ raise _('Please provide --lifecycle-environment-id') unless env_id
24
+
25
+ raise _('Please provide --content-view-id') unless cv_id
26
+ # rubocop:disable LineLength
27
+ resource_hash['kickstart_repository_id'] = HammerCLIKatello::CommandExtensions::KickstartRepository.fetch_repo_id(
28
+ cv_id, env_id, cmd_obj.option_kickstart_repository
29
+ )
30
+ # rubocop:enable LineLength
31
+ end
32
+ end
33
+
34
+ def self.fetch_repo_id(cv_id, env_id, repo_name)
35
+ repo_resource = HammerCLIForeman.foreman_resource(:repositories)
36
+ index_options = {
37
+ content_view_id: cv_id,
38
+ environment_id: env_id,
39
+ name: repo_name
40
+ }
41
+ repos = repo_resource.call(:index, index_options)['results']
42
+ if repos.empty?
43
+ raise _("No such repository with name %{name}, in lifecycle environment"\
44
+ " %{environment_id} and content view %{content_view_id}" % index_options)
45
+ end
46
+ repos.first['id']
47
+ end
48
+ end
49
+ end
50
+ end
@@ -13,6 +13,18 @@ module HammerCLIKatello
13
13
  attribute_name: :option_environment_id
14
14
  end
15
15
 
16
+ # Add explicitly defined options since option builder won't be
17
+ # able to create options automatically in case there is missing resource
18
+ # in API docs or if the resource name is different
19
+ # (e.g. environment instead of lifecycle_environment)
20
+ # This can happen if API docs contain a param which cannot be mapped
21
+ # via param_name to resource_name mapping
22
+ option_family associate: 'lifecycle_environment' do
23
+ child '--lifecycle-environment', 'ENVIRONMENT_NAME',
24
+ _('Lifecycle environment name to search by'),
25
+ attribute_name: :option_environment_name
26
+ end
27
+
16
28
  option_sources do |sources, command|
17
29
  sources.find_by_name('IdResolution').insert_relative(
18
30
  :after,
@@ -3,3 +3,5 @@
3
3
  require 'hammer_cli_katello/command_extensions/lifecycle_environment'
4
4
  require 'hammer_cli_katello/command_extensions/lifecycle_environments'
5
5
  require 'hammer_cli_katello/command_extensions/ping'
6
+ require 'hammer_cli_katello/command_extensions/content_source'
7
+ require 'hammer_cli_katello/command_extensions/kickstart_repository'
@@ -36,7 +36,7 @@ module HammerCLIKatello
36
36
  end
37
37
 
38
38
  def resource_name_mapping
39
- HammerCLIKatello::RESOURCE_NAME_MAPPING.dup
39
+ super.merge(HammerCLIKatello::RESOURCE_NAME_MAPPING.dup)
40
40
  end
41
41
  end
42
42
  end
@@ -162,14 +162,18 @@ module HammerCLIKatello
162
162
  :required => false
163
163
 
164
164
  base.build_options do |o|
165
- o.expand(:all).including(:content_views, :organizations, :environments)
165
+ o.expand(:all).including(:content_views, :organizations, :lifecycle_environments)
166
166
  o.without(:environment_ids, :environment_id)
167
167
  end
168
168
 
169
169
  base.validate_options do
170
170
  unless option(:option_id).exist?
171
171
  any(:option_id, :option_content_view_name, :option_content_view_id).required
172
- any(:option_version, :option_environment_id, :option_environment_name).required
172
+ any(
173
+ :option_version,
174
+ :option_lifecycle_environment_id,
175
+ :option_lifecycle_environment_name
176
+ ).required
173
177
  unless option(:option_content_view_id).exist?
174
178
  any(:option_organization_id, :option_organization_name, \
175
179
  :option_organization_label).required
@@ -197,6 +197,17 @@ module HammerCLIKatello
197
197
  failure_message _("Could not publish the content view")
198
198
 
199
199
  build_options
200
+
201
+ option_family associate: 'lifecycle_environment' do
202
+ child '--lifecycle-environments', 'LIFECYCLE_ENVIRONMENT_NAMES',
203
+ _('Names for Lifecycle Environment'),
204
+ format: HammerCLI::Options::Normalizers::List.new,
205
+ attribute_name: :option_environment_names
206
+ end
207
+
208
+ extend_with(
209
+ HammerCLIKatello::CommandExtensions::LifecycleEnvironments.new(only: :option_sources)
210
+ )
200
211
  end
201
212
 
202
213
  class RemoveFromEnvironmentCommand < HammerCLIKatello::SingleResourceCommand
@@ -60,7 +60,7 @@ module HammerCLIKatello
60
60
  end
61
61
 
62
62
  build_options do |o|
63
- o.expand(:all).including(:environments, :content_views, :organizations)
63
+ o.expand(:all).including(:lifecycle_environments, :content_views, :organizations)
64
64
  end
65
65
 
66
66
  extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
@@ -143,7 +143,7 @@ module HammerCLIKatello
143
143
  failure_message _("Could not delete the content view")
144
144
 
145
145
  build_options do |o|
146
- o.expand(:all).including(:environments, :content_views, :organizations)
146
+ o.expand(:all).including(:lifecycle_environments, :content_views, :organizations)
147
147
  end
148
148
 
149
149
  extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
@@ -157,7 +157,7 @@ module HammerCLIKatello
157
157
  failure_message _("Could not update the content view version")
158
158
 
159
159
  build_options do |o|
160
- o.expand(:all).including(:environments, :content_views, :organizations)
160
+ o.expand(:all).including(:lifecycle_environments, :content_views, :organizations)
161
161
  end
162
162
 
163
163
  extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
@@ -46,10 +46,9 @@ module HammerCLIKatello
46
46
  end
47
47
 
48
48
  class RecalculateCommand < HammerCLIKatello::SingleResourceCommand
49
- include HammerCLIForemanTasks::Async
50
49
  resource :host_errata, :applicability
51
50
  command_name "recalculate"
52
- success_message _("Errata recalculated with task %{id}.")
51
+ success_message _("Errata recalculation started.")
53
52
  failure_message _("Could not recalculate errata")
54
53
 
55
54
  build_options
@@ -3,23 +3,25 @@ require 'hammer_cli_katello/host_errata'
3
3
  require 'hammer_cli_katello/host_subscription'
4
4
  require 'hammer_cli_katello/host_package'
5
5
  require 'hammer_cli_katello/host_package_group'
6
- require 'hammer_cli_katello/host_kickstart_repository_options'
7
- require 'hammer_cli_katello/host_content_source_options'
8
6
  require 'hammer_cli_katello/host_traces'
9
7
 
10
8
  module HammerCLIKatello
11
9
  module HostExtensions
12
10
  ::HammerCLIForeman::Host::CreateCommand.instance_eval do
13
11
  include HammerCLIKatello::ResolverCommons
14
- include HammerCLIKatello::HostContentSourceOptions
15
- include ::HammerCLIKatello::HostKickstartRepositoryOptions
16
12
  end
13
+ ::HammerCLIForeman::Host::CreateCommand.extend_with(
14
+ HammerCLIKatello::CommandExtensions::ContentSource.new,
15
+ HammerCLIKatello::CommandExtensions::KickstartRepository.new
16
+ )
17
17
 
18
18
  ::HammerCLIForeman::Host::UpdateCommand.instance_eval do
19
19
  include HammerCLIKatello::ResolverCommons
20
- include HammerCLIKatello::HostContentSourceOptions
21
- include ::HammerCLIKatello::HostKickstartRepositoryOptions
22
20
  end
21
+ ::HammerCLIForeman::Host::UpdateCommand.extend_with(
22
+ HammerCLIKatello::CommandExtensions::ContentSource.new,
23
+ HammerCLIKatello::CommandExtensions::KickstartRepository.new
24
+ )
23
25
 
24
26
  ::HammerCLIForeman::Host::ListCommand.instance_eval do
25
27
  output do
@@ -1,16 +1,19 @@
1
1
  require 'hammer_cli_foreman/hostgroup'
2
- require 'hammer_cli_katello/host_kickstart_repository_options'
3
- require 'hammer_cli_katello/host_content_source_options'
4
2
 
5
3
  module HammerCLIKatello
6
4
  module QueryOrganizationOptions
7
5
  def self.included(base)
8
- base.option '--query-organization-id', 'ORGANIZATION_ID',
9
- _('Organization ID to search by'), attribute_name: :option_organization_id
10
- base.option '--query-organization', 'ORGANIZATION_NAME',
11
- _('Organization name to search by'), attribute_name: :option_organization_name
12
- base.option '--query-organization-label', 'ORGANIZATION_LABEL',
13
- _('Organization label to search by'), attribute_name: :option_organization_label
6
+ base.option_family do
7
+ parent '--query-organization-id', 'ORGANIZATION_ID',
8
+ _('Organization ID to search by'),
9
+ attribute_name: :option_organization_id
10
+ child '--query-organization', 'ORGANIZATION_NAME',
11
+ _('Organization name to search by'),
12
+ attribute_name: :option_organization_name
13
+ child '--query-organization-label', 'ORGANIZATION_LABEL',
14
+ _('Organization label to search by'),
15
+ attribute_name: :option_organization_label
16
+ end
14
17
 
15
18
  base.validate_options :before, 'IdResolution' do
16
19
  organization_options = [
@@ -30,17 +33,21 @@ module HammerCLIKatello
30
33
  include HammerCLIKatello::ResolverCommons
31
34
  include HammerCLIKatello::ContentViewNameResolvable
32
35
  include HammerCLIKatello::QueryOrganizationOptions
33
- include HammerCLIKatello::HostContentSourceOptions
34
- include HammerCLIKatello::HostKickstartRepositoryOptions
35
36
  end
37
+ ::HammerCLIForeman::Hostgroup::CreateCommand.extend_with(
38
+ HammerCLIKatello::CommandExtensions::ContentSource.new,
39
+ HammerCLIKatello::CommandExtensions::KickstartRepository.new
40
+ )
36
41
 
37
42
  ::HammerCLIForeman::Hostgroup::UpdateCommand.instance_eval do
38
43
  include HammerCLIKatello::ResolverCommons
39
44
  include HammerCLIKatello::ContentViewNameResolvable
40
45
  include HammerCLIKatello::QueryOrganizationOptions
41
- include HammerCLIKatello::HostContentSourceOptions
42
- include HammerCLIKatello::HostKickstartRepositoryOptions
43
46
  end
47
+ ::HammerCLIForeman::Hostgroup::UpdateCommand.extend_with(
48
+ HammerCLIKatello::CommandExtensions::ContentSource.new,
49
+ HammerCLIKatello::CommandExtensions::KickstartRepository.new
50
+ )
44
51
 
45
52
  ::HammerCLIForeman::Hostgroup::InfoCommand.instance_eval do
46
53
  output do
@@ -74,12 +74,15 @@ module HammerCLIKatello
74
74
  return options['option_lifecycle_environment_ids']
75
75
  end
76
76
 
77
- key_names = HammerCLI.option_accessor_name 'lifecycle_environment_names'
77
+ names = options[HammerCLI.option_accessor_name('lifecycle_environment_names')] ||
78
+ options[HammerCLI.option_accessor_name('environment_names')] ||
79
+ options[HammerCLI.option_accessor_name('names')]
78
80
  key_organization_id = HammerCLI.option_accessor_name 'organization_id'
79
81
  options[key_organization_id] ||= organization_id(scoped_options('organization', options))
80
82
 
83
+ options['option_lifecycle_environment_names'] = names
81
84
  find_resources(:lifecycle_environments, options)
82
- .select { |repo| options[key_names].include? repo['name'] }.map { |repo| repo['id'] }
85
+ .select { |repo| names.include? repo['name'] }.map { |repo| repo['id'] }
83
86
  end
84
87
 
85
88
  def repository_id(options)
@@ -6,15 +6,52 @@ module HammerCLIKatello
6
6
  end
7
7
 
8
8
  def get_options(_defined_options, result)
9
+ legacy_option_id(result)
10
+ legacy_option_ids(result)
11
+ ensure_option_id(result)
12
+ ensure_option_ids(result)
13
+ result
14
+ end
15
+
16
+ private
17
+
18
+ def lifecycle_environment_resource_name
19
+ (HammerCLIForeman.param_to_resource('environment') ||
20
+ HammerCLIForeman.param_to_resource('lifecycle_environment')).singular_name
21
+ end
22
+
23
+ def legacy_option_id(result)
9
24
  if result['option_environment_name'] && result['option_environment_id'].nil?
10
25
  result['option_environment_id'] = @command.resolver.lifecycle_environment_id(
11
- @command.resolver.scoped_options('environment', result, :single))
26
+ @command.resolver.scoped_options(lifecycle_environment_resource_name, result, :single))
12
27
  end
28
+ end
29
+
30
+ def legacy_option_ids(result)
13
31
  if result['option_environment_names'] && result['option_environment_ids'].nil?
14
32
  result['option_environment_ids'] = @command.resolver.lifecycle_environment_ids(
15
- @command.resolver.scoped_options('environment', result, :multi))
33
+ @command.resolver.scoped_options(lifecycle_environment_resource_name, result, :multi))
34
+ end
35
+ end
36
+
37
+ def ensure_option_id(result)
38
+ if result['option_environment_id'].nil? && result['option_lifecycle_environment_name']
39
+ id = @command.resolver.lifecycle_environment_id(
40
+ @command.resolver.scoped_options(lifecycle_environment_resource_name, result, :single)
41
+ )
42
+ result['option_environment_id'] = id
43
+ result['option_lifecycle_environment_id'] = id
44
+ end
45
+ end
46
+
47
+ def ensure_option_ids(result)
48
+ if result['option_environment_ids'].nil? && result['option_lifecycle_environment_names']
49
+ ids = @command.resolver.lifecycle_environment_ids(
50
+ @command.resolver.scoped_options(lifecycle_environment_resource_name, result, :multi)
51
+ )
52
+ result['option_environment_ids'] = ids
53
+ result['option_lifecycle_environment_ids'] = ids
16
54
  end
17
- result
18
55
  end
19
56
  end
20
57
  end
@@ -20,9 +20,17 @@ module HammerCLIKatello
20
20
  output do
21
21
  field :label, _("Label")
22
22
  field :description, _("Description")
23
- field :redhat_repository_url, _("Red Hat Repository URL")
24
23
  field :simple_content_access_label, _("Simple Content Access")
25
24
  field :service_levels, _("Service Levels"), Fields::List
25
+ from :cdn_configuration do
26
+ label "CDN configuration", hide_blank: true do
27
+ field :url, _("URL"), Fields::Field, hide_blank: true
28
+ field :upstream_organization_label, _("Upstream Organization"),
29
+ Fields::Field, hide_blank: true
30
+ field :username, _("Username"), Fields::Field, hide_blank: true
31
+ field :ssl_ca_credential_id, _("SSL CA Credential ID"), Fields::Field, hide_blank: true
32
+ end
33
+ end
26
34
  end
27
35
 
28
36
  def extend_data(data)
@@ -44,7 +52,9 @@ module HammerCLIKatello
44
52
  success_message _("Organization updated.")
45
53
  failure_message _("Could not update the organization")
46
54
 
47
- build_options
55
+ build_options do |o|
56
+ o.expand(:all).except(:environments)
57
+ end
48
58
  end
49
59
 
50
60
  class CreateCommand < HammerCLIForeman::Organization::CreateCommand
@@ -54,7 +64,9 @@ module HammerCLIKatello
54
64
  success_message _("Organization created.")
55
65
  failure_message _("Could not create the organization")
56
66
 
57
- build_options
67
+ build_options do |o|
68
+ o.expand(:all).except(:environments)
69
+ end
58
70
  end
59
71
 
60
72
  class DeleteCommand < HammerCLIForeman::Organization::DeleteCommand
@@ -68,6 +80,19 @@ module HammerCLIKatello
68
80
  build_options
69
81
  end
70
82
 
83
+ class ConfigureCdnCommand < HammerCLIKatello::SingleResourceCommand
84
+ include HammerCLIKatello::ResolverCommons
85
+ resource :organizations, :cdn_configuration
86
+ command_name "configure-cdn"
87
+ success_message _("Updated CDN configuration.")
88
+ failure_message _("Could not update CDN configuration.")
89
+
90
+ build_options do |o|
91
+ o.expand(:all).except(:organizations, :locations)
92
+ o.without(:organization_id, :location_id)
93
+ end
94
+ end
95
+
71
96
  autoload_subcommands
72
97
  end
73
98
  end
@@ -3,7 +3,6 @@ module HammerCLIKatello
3
3
  resource :packages
4
4
 
5
5
  class ListCommand < HammerCLIKatello::ListCommand
6
- extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
7
6
  include LifecycleEnvironmentNameMapping
8
7
 
9
8
  output do
@@ -40,6 +39,8 @@ module HammerCLIKatello
40
39
  build_options do |o|
41
40
  o.expand.including(:products, :content_views)
42
41
  end
42
+
43
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
43
44
  end
44
45
 
45
46
  class InfoCommand < HammerCLIKatello::InfoCommand
@@ -51,6 +51,13 @@ module HammerCLIKatello
51
51
  end
52
52
  end
53
53
 
54
+ label "pulp3_content", :hide_blank => true do
55
+ from "pulp3_content" do
56
+ field "status", _("Status"), Fields::Field, :hide_blank => true
57
+ field "_response", _("Server Response"), Fields::Field, :hide_blank => true
58
+ end
59
+ end
60
+
54
61
  label "foreman_tasks" do
55
62
  from "foreman_tasks" do
56
63
  field "status", _("Status")
@@ -62,10 +62,6 @@ module HammerCLIKatello
62
62
  field :full_path, _("Published At")
63
63
  field :relative_path, _("Relative Path")
64
64
  field :download_policy, _("Download Policy"), Fields::Field, :hide_blank => true
65
- field :ostree_upstream_sync_policy, _("OSTree Upstream Sync Policy"),
66
- Fields::Field, :hide_blank => true
67
- field :_ostree_upstream_sync_depth, _("OSTree Upstream Sync Depth"),
68
- Fields::Field, :hide_blank => true
69
65
  field :docker_upstream_name, _("Upstream Repository Name"),
70
66
  Fields::Field, :hide_blank => true
71
67
  field :docker_tags_whitelist, _("Container Image Tags Filter"),
@@ -403,6 +399,12 @@ module HammerCLIKatello
403
399
  build_options(:without => [:content]) do |o|
404
400
  o.expand.including(:products, :organizations)
405
401
  end
402
+
403
+ option "--ostree-repository-name", "OSTREE REPOSITORY NAME",
404
+ _("Name of OSTree repository in archive."),
405
+ :attribute_name => :option_ostree_repository_name,
406
+ :required => false
407
+
406
408
  option "--path", "PATH", _("Upload file, directory of files, or glob of files " \
407
409
  "as content for a repository.\n" \
408
410
  "Globs must be escaped by single or double quotes"),
@@ -423,6 +425,7 @@ module HammerCLIKatello
423
425
  repo_id = get_identifier
424
426
  update_content_upload(upload_id, repo_id, file)
425
427
  end
428
+ opts[:ostree_repository_name] = options["option_ostree_repository_name"]
426
429
  results = import_uploads([
427
430
  {
428
431
  id: upload_id,
@@ -479,6 +482,9 @@ module HammerCLIKatello
479
482
  sync_capsule: sync_capsule
480
483
  }
481
484
  params[:content_type] = options["option_content_type"] if options["option_content_type"]
485
+ if options["option_ostree_repository_name"]
486
+ params[:ostree_repository_name] = options["option_ostree_repository_name"]
487
+ end
482
488
  resource.call(:import_uploads, params)
483
489
  end
484
490
 
@@ -57,7 +57,8 @@ module HammerCLIKatello
57
57
  def create_lifecycle_environments_search_options(options, mode = nil)
58
58
  search_options = {}
59
59
  if mode != :multi
60
- name = options[HammerCLI.option_accessor_name("name")]
60
+ name = options[HammerCLI.option_accessor_name("environment_name")] ||
61
+ options[HammerCLI.option_accessor_name("name")]
61
62
  search_options['name'] = name if name
62
63
  end
63
64
  organization_id = organization_id(scoped_options('organization', options, :single))
@@ -39,6 +39,8 @@ module HammerCLIKatello
39
39
  build_options do |o|
40
40
  o.expand.including(:products, :content_views)
41
41
  end
42
+
43
+ extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
42
44
  end
43
45
 
44
46
  class InfoCommand < HammerCLIKatello::InfoCommand
@@ -1,5 +1,5 @@
1
1
  module HammerCLIKatello
2
2
  def self.version
3
- @version ||= Gem::Version.new('1.2.0')
3
+ @version ||= Gem::Version.new('1.3.0')
4
4
  end
5
5
  end