hammer_cli_katello 0.24.2 → 1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hammer_cli_katello.rb +6 -14
  3. data/lib/hammer_cli_katello/activation_key.rb +5 -5
  4. data/lib/hammer_cli_katello/capsule.rb +2 -3
  5. data/lib/hammer_cli_katello/command_extensions/lifecycle_environment.rb +10 -7
  6. data/lib/hammer_cli_katello/command_extensions/lifecycle_environments.rb +11 -8
  7. data/lib/hammer_cli_katello/content_credential.rb +20 -19
  8. data/lib/hammer_cli_katello/content_export.rb +1 -0
  9. data/lib/hammer_cli_katello/content_export_helper.rb +1 -1
  10. data/lib/hammer_cli_katello/content_view.rb +16 -31
  11. data/lib/hammer_cli_katello/content_view_version.rb +4 -11
  12. data/lib/hammer_cli_katello/deb_package.rb +3 -3
  13. data/lib/hammer_cli_katello/erratum.rb +1 -1
  14. data/lib/hammer_cli_katello/erratum_info_command.rb +1 -1
  15. data/lib/hammer_cli_katello/file.rb +3 -3
  16. data/lib/hammer_cli_katello/filter.rb +2 -2
  17. data/lib/hammer_cli_katello/foreman_search_options_creators.rb +0 -12
  18. data/lib/hammer_cli_katello/host_collection.rb +2 -2
  19. data/lib/hammer_cli_katello/host_deb.rb +1 -1
  20. data/lib/hammer_cli_katello/host_errata.rb +1 -1
  21. data/lib/hammer_cli_katello/host_extensions.rb +5 -5
  22. data/lib/hammer_cli_katello/host_package.rb +1 -1
  23. data/lib/hammer_cli_katello/hostgroup_extensions.rb +4 -4
  24. data/lib/hammer_cli_katello/id_resolver.rb +5 -6
  25. data/lib/hammer_cli_katello/lifecycle_environment.rb +2 -2
  26. data/lib/hammer_cli_katello/module_stream.rb +8 -8
  27. data/lib/hammer_cli_katello/organization_options.rb +8 -6
  28. data/lib/hammer_cli_katello/ostree_branch.rb +2 -2
  29. data/lib/hammer_cli_katello/package.rb +5 -5
  30. data/lib/hammer_cli_katello/package_group.rb +4 -4
  31. data/lib/hammer_cli_katello/ping.rb +0 -14
  32. data/lib/hammer_cli_katello/product.rb +3 -3
  33. data/lib/hammer_cli_katello/product_content.rb +2 -2
  34. data/lib/hammer_cli_katello/repository.rb +6 -37
  35. data/lib/hammer_cli_katello/repository_set.rb +4 -4
  36. data/lib/hammer_cli_katello/simple_content_access.rb +40 -0
  37. data/lib/hammer_cli_katello/srpm.rb +2 -2
  38. data/lib/hammer_cli_katello/subscription.rb +2 -3
  39. data/lib/hammer_cli_katello/sync_plan.rb +2 -2
  40. data/lib/hammer_cli_katello/version.rb +1 -1
  41. data/test/data/3.18/foreman_api.json +1 -1
  42. data/test/data/3.19/foreman_api.json +1 -0
  43. data/test/data/4.0/foreman_api.json +1 -0
  44. data/test/functional/capsule/content/info_test.rb +1 -2
  45. data/test/functional/content_credentials/create_test.rb +32 -0
  46. data/test/functional/{repository → content_credentials}/data/test_cert.json +0 -0
  47. data/test/functional/content_credentials/list_test.rb +6 -8
  48. data/test/functional/content_export/list_test.rb +33 -3
  49. data/test/functional/content_view/list_test.rb +0 -2
  50. data/test/functional/content_view/publish_test.rb +0 -21
  51. data/test/functional/content_view/version/promote_test.rb +1 -2
  52. data/test/functional/content_view/version/republish_repositories_test.rb +1 -2
  53. data/test/functional/host/errata/apply_test.rb +0 -2
  54. data/test/functional/host/errata/recalculate_test.rb +0 -2
  55. data/test/functional/ping_test.rb +0 -2
  56. data/test/functional/repository/create_test.rb +0 -30
  57. data/test/functional/repository/info_test.rb +4 -4
  58. data/test/functional/repository/list_test.rb +0 -2
  59. data/test/functional/simple_content_access/disable_test.rb +48 -0
  60. data/test/functional/simple_content_access/enable_test.rb +46 -0
  61. data/test/test_helper.rb +1 -1
  62. metadata +15 -17
  63. data/lib/hammer_cli_katello/content_view_puppet_module.rb +0 -60
  64. data/lib/hammer_cli_katello/gpg_key.rb +0 -67
  65. data/lib/hammer_cli_katello/puppet_module.rb +0 -59
  66. data/test/functional/content_view/puppet_module/add_test.rb +0 -24
  67. data/test/functional/content_view/puppet_module/remove_test.rb +0 -54
  68. data/test/functional/gpg_test.rb +0 -39
  69. data/test/functional/repository/data/test_ca.json +0 -43
  70. data/test/functional/repository/data/test_key.json +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f913438c207c69774eadb286a20e8cb249c77eef5c64fec2b431d3d5bdfe11d
4
- data.tar.gz: b00a4f7143e13ca251ee5ba533277c786c887f9211ed1273e35124f6006d83a5
3
+ metadata.gz: 6a4a20566a58ddf6462ecdc274f1d4f7e107c482ac79ab93b42db2ab11b6d45e
4
+ data.tar.gz: 6ad63b1d4e551613de6508c34f137f835934c34731e6dcbb18e69a20b51d421a
5
5
  SHA512:
6
- metadata.gz: d555ffa3fe7daf61efc108c218646aa42e8923686b3e28a23fbf137354c2a7645de12ca0ab44ccaab524ae00690a143a783f0668fa8b998be8e12b17714f0400
7
- data.tar.gz: ef7a75b53d2e1ed73f64156b77935e634042394b15edad9e4d28ed23350496d089359d4dc1b2a037a7aef42e48ca58cbada276e8e7fc03fd2391f68361f5677e
6
+ metadata.gz: 179e73dd5c1186e82ff0265cb7eeb36f1a86daee9b2fe915d9cb3fe855ae62420601d2f7ca3adb153d70ffaadaa492be3086ecf129ed17b9435441d8727ac2e1
7
+ data.tar.gz: 8918cf5f6376226d4cecd99a70dbadd59d3a7ba2d029517a06849e3f89a9e94b0ea5a76ce46edb60847ceb64b2dcf0af0724a86530541231cf0ae22fa2d2c593
@@ -44,15 +44,6 @@ module HammerCLIKatello
44
44
  'hammer_cli_katello/organization'
45
45
  )
46
46
 
47
- HammerCLI::MainCommand.lazy_subcommand("gpg",
48
- _("Manipulate GPG Key actions on the server"),
49
- 'HammerCLIKatello::GpgKeyCommand',
50
- 'hammer_cli_katello/gpg_key',
51
- :warning =>
52
- _('The gpg sub-command is deprecated and will be removed in one of the future versions.' \
53
- ' Please use the content-credentials command instead.')
54
- )
55
-
56
47
  HammerCLI::MainCommand.lazy_subcommand("content-credentials",
57
48
  _("Manipulate content credentials on the server"),
58
49
  'HammerCLIKatello::ContentCredentialCommand',
@@ -70,11 +61,6 @@ module HammerCLIKatello
70
61
  'hammer_cli_katello/product'
71
62
  )
72
63
 
73
- HammerCLI::MainCommand.lazy_subcommand("puppet-module", _("View Puppet Module details"),
74
- 'HammerCLIKatello::PuppetModule',
75
- 'hammer_cli_katello/puppet_module'
76
- )
77
-
78
64
  HammerCLI::MainCommand.lazy_subcommand("repository", _("Manipulate repositories"),
79
65
  'HammerCLIKatello::Repository',
80
66
  'hammer_cli_katello/repository'
@@ -164,6 +150,12 @@ module HammerCLIKatello
164
150
  'hammer_cli_katello/srpm'
165
151
  )
166
152
 
153
+ HammerCLI::MainCommand.lazy_subcommand("simple-content-access",
154
+ _("Simple content access commands"),
155
+ 'HammerCLIKatello::SimpleContentAccess',
156
+ 'hammer_cli_katello/simple_content_access'
157
+ )
158
+
167
159
  # subcommands to hammer_cli_foreman commands
168
160
  require 'hammer_cli_katello/host'
169
161
  require 'hammer_cli_katello/hostgroup'
@@ -11,7 +11,7 @@ module HammerCLIKatello
11
11
  action :index
12
12
 
13
13
  output do
14
- field :id, _("ID")
14
+ field :id, _("Id")
15
15
  field :name, _("Name")
16
16
  field :format_consumed, _("Host Limit")
17
17
  from :environment do
@@ -53,7 +53,7 @@ module HammerCLIKatello
53
53
 
54
54
  output do
55
55
  field :name, _("Name")
56
- field :id, _("ID")
56
+ field :id, _("Id")
57
57
  field :description, _("Description")
58
58
  field :format_limit, _("Host Limit")
59
59
  field :auto_attach, _("Auto Attach")
@@ -67,7 +67,7 @@ module HammerCLIKatello
67
67
  end
68
68
 
69
69
  collection :host_collections, _("Host Collections") do
70
- field :id, _("ID")
70
+ field :id, _("Id")
71
71
  field :name, _("Name")
72
72
  end
73
73
 
@@ -150,7 +150,7 @@ module HammerCLIKatello
150
150
  command_name "subscriptions"
151
151
 
152
152
  output do
153
- field :id, _("ID")
153
+ field :id, _("Id")
154
154
  field :product_name, _("Name")
155
155
  field :format_consumed, _("Attached")
156
156
  field :quantity_attached, _("Quantity")
@@ -230,7 +230,7 @@ module HammerCLIKatello
230
230
  command_name "host-collections"
231
231
 
232
232
  output do
233
- field :id, _("ID")
233
+ field :id, _("Id")
234
234
  field :name, _("Name")
235
235
  end
236
236
 
@@ -13,7 +13,7 @@ module HammerCLIKatello
13
13
  command_name 'lifecycle-environments'
14
14
 
15
15
  output do
16
- field :id, _("ID")
16
+ field :id, _("Id")
17
17
  field :name, _("Name")
18
18
  from :organization do
19
19
  field :name, _("Organization")
@@ -28,7 +28,7 @@ module HammerCLIKatello
28
28
  command_name 'available-lifecycle-environments'
29
29
 
30
30
  output do
31
- field :id, _("ID")
31
+ field :id, _("Id")
32
32
  field :name, _("Name")
33
33
  from :organization do
34
34
  field :name, _("Organization")
@@ -167,7 +167,6 @@ module HammerCLIKatello
167
167
  field :packages, _('Packages')
168
168
  field :package_groups, _('Package groups')
169
169
  field :errata, _('Errata')
170
- field :puppet_modules, _('Puppet modules')
171
170
  end
172
171
  end
173
172
  end
@@ -2,13 +2,16 @@ module HammerCLIKatello
2
2
  module CommandExtensions
3
3
  class LifecycleEnvironment < HammerCLI::CommandExtensions
4
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') }
5
+ option_family(
6
+ deprecated: { '--environment' => _("Use %s instead") % '--lifecycle-environment',
7
+ '--environment-id' => _("Use %s instead") % '--lifecycle-environment-id'}
8
+ ) do
9
+ child '--environment', 'ENVIRONMENT_NAME', _('Lifecycle environment name to search by'),
10
+ attribute_name: :option_environment_name
11
+ parent '--environment-id', 'ENVIRONMENT_ID', _(''),
12
+ format: HammerCLI::Options::Normalizers::Number.new,
13
+ attribute_name: :option_environment_id
14
+ end
12
15
 
13
16
  option_sources do |sources, command|
14
17
  sources.find_by_name('IdResolution').insert_relative(
@@ -2,14 +2,17 @@ module HammerCLIKatello
2
2
  module CommandExtensions
3
3
  class LifecycleEnvironments < HammerCLI::CommandExtensions
4
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') }
5
+ option_family(
6
+ format: HammerCLI::Options::Normalizers::List.new,
7
+ deprecation: _("Use %s instead") % '--lifecycle-environment[s|-ids]',
8
+ deprecated: { '--environments' => _("Use %s instead") % '--lifecycle-environments',
9
+ '--environment-ids' => _("Use %s instead") % '--lifecycle-environment-ids'}
10
+ ) do
11
+ parent '--environment-ids', 'ENVIRONMENT_IDS', _(''),
12
+ attribute_name: :option_environment_ids
13
+ child '--environments', 'ENVIRONMENT_NAMES', _(''),
14
+ attribute_name: :option_environment_names
15
+ end
13
16
 
14
17
  option_sources do |sources, command|
15
18
  sources.find_by_name('IdResolution').insert_relative(
@@ -4,8 +4,9 @@ module HammerCLIKatello
4
4
 
5
5
  class ListCommand < HammerCLIKatello::ListCommand
6
6
  output do
7
- field :id, _("ID")
8
- field :name, _("Name")
7
+ field :id, _('Id')
8
+ field :name, _('Name')
9
+ field :content_type, _('Content Type')
9
10
  end
10
11
 
11
12
  build_options
@@ -13,51 +14,51 @@ module HammerCLIKatello
13
14
 
14
15
  class InfoCommand < HammerCLIKatello::InfoCommand
15
16
  output do
16
- field :id, _("ID")
17
- field :name, _("Name")
17
+ field :id, _('Id')
18
+ field :name, _('Name')
18
19
  from :organization do
19
- field :name, _("Organization")
20
+ field :name, _('Organization')
20
21
  end
21
22
 
22
- collection :repositories, "Repositories" do
23
- field :id, _("ID")
24
- field :name, _("Name")
25
- field :content_type, _("Content Type")
23
+ collection :repositories, 'Repositories' do
24
+ field :id, _('Id')
25
+ field :name, _('Name')
26
+ field :content_type, _('Content Type')
26
27
  from :product do
27
- field :name, _("Product")
28
+ field :name, _('Product')
28
29
  end
29
30
  end
30
31
 
31
- field :content, _("Content"), Fields::LongText
32
+ field :content, _('Content'), Fields::LongText
32
33
  end
33
34
 
34
35
  build_options
35
36
  end
36
37
 
37
38
  class CreateCommand < HammerCLIKatello::CreateCommand
38
- success_message _("Content credential created.")
39
- failure_message _("Could not create GPG key")
39
+ success_message _('Content Credential created.')
40
+ failure_message _('Could not create Content Credential')
40
41
 
41
42
  build_options :without => [:content]
42
- option "--key", "GPG_KEY_FILE", _("GPG Key file"),
43
+ option '--path', 'KEY_FILE', _('Key file'),
43
44
  :attribute_name => :option_content,
44
45
  :required => true,
45
46
  :format => HammerCLI::Options::Normalizers::File.new
46
47
  end
47
48
 
48
49
  class UpdateCommand < HammerCLIKatello::UpdateCommand
49
- success_message _("GPG Key updated.")
50
- failure_message _("Could not update GPG Key")
50
+ success_message _('Content Credential updated.')
51
+ failure_message _('Could not update Content Credential')
51
52
 
52
53
  build_options :without => [:content]
53
- option "--key", "GPG_KEY_FILE", _("GPG Key file"),
54
+ option '--path', 'KEY_FILE', _('Key file'),
54
55
  :attribute_name => :option_content,
55
56
  :format => HammerCLI::Options::Normalizers::File.new
56
57
  end
57
58
 
58
59
  class DeleteCommand < HammerCLIKatello::DeleteCommand
59
- success_message _("GPG Key deleted.")
60
- failure_message _("Could not delete the GPG Key")
60
+ success_message _('Content Credential deleted.')
61
+ failure_message _('Could not delete the Content Credential')
61
62
 
62
63
  build_options
63
64
  end
@@ -50,6 +50,7 @@ module HammerCLIKatello
50
50
  field :id, _('ID')
51
51
  field :destination_server, _('Destination Server')
52
52
  field :path, _('Path')
53
+ field :type, _('Type')
53
54
  field :content_view_version, _('Content View Version')
54
55
  field :content_view_version_id, _('Content View Version ID')
55
56
  field :created_at, _('Created at')
@@ -40,7 +40,7 @@ module HammerCLIKatello
40
40
  end
41
41
 
42
42
  def fetch_export_history(export_history_id)
43
- resource.call(:index, :id => export_history_id)["results"].first if export_history_id
43
+ index(:content_exports, :id => export_history_id).first if export_history_id
44
44
  end
45
45
 
46
46
  def fetch_export_history_from_task(task)
@@ -1,4 +1,3 @@
1
- require 'hammer_cli_katello/content_view_puppet_module'
2
1
  require 'hammer_cli_katello/content_view_purge'
3
2
  require 'hammer_cli_katello/filter'
4
3
  require 'hammer_cli_katello/content_view_version'
@@ -29,13 +28,12 @@ module HammerCLIKatello
29
28
  include OrganizationOptions
30
29
 
31
30
  output do
32
- field :id, _("ID")
31
+ field :id, _("Id")
33
32
  field :name, _("Name")
34
33
  field :label, _("Label")
35
34
  field :composite, _("Composite")
36
35
  field :description, _("Description")
37
36
  field :content_host_count, _("Content Host Count")
38
- field :force_puppet_environment, _("Force Puppet")
39
37
  field :solve_dependencies, _("Solve Dependencies")
40
38
 
41
39
  from :organization do
@@ -43,43 +41,36 @@ module HammerCLIKatello
43
41
  end
44
42
 
45
43
  collection :_yum_repositories, _("Yum Repositories") do
46
- field :id, _("ID")
44
+ field :id, _("Id")
47
45
  field :name, _("Name")
48
46
  field :label, _("Label")
49
47
  end
50
48
 
51
49
  collection :_docker_repositories, _("Container Image Repositories") do
52
- field :id, _("ID")
50
+ field :id, _("Id")
53
51
  field :name, _("Name")
54
52
  field :label, _("Label")
55
53
  end
56
54
 
57
55
  collection :_ostree_repositories, _("OSTree Repositories") do
58
- field :id, _("ID")
56
+ field :id, _("Id")
59
57
  field :name, _("Name")
60
58
  field :label, _("Label")
61
59
  end
62
60
 
63
- collection :puppet_modules, _("Puppet Modules") do
64
- field :id, _("ID")
65
- field :uuid, _("UUID"), Fields::Field, :hide_blank => true
66
- field :name, _("Name")
67
- field :author, _("Author")
68
- end
69
-
70
61
  collection :environments, _("Lifecycle Environments") do
71
- field :id, _("ID")
62
+ field :id, _("Id")
72
63
  field :name, _("Name")
73
64
  end
74
65
 
75
66
  collection :versions, _("Versions") do
76
- field :id, _("ID")
67
+ field :id, _("Id")
77
68
  field :version, _("Version")
78
69
  field :published, _("Published"), Fields::Date
79
70
  end
80
71
 
81
72
  collection :components, _("Components") do
82
- field :id, _("ID")
73
+ field :id, _("Id")
83
74
  field :name, _("Name")
84
75
  end
85
76
 
@@ -246,13 +237,6 @@ module HammerCLIKatello
246
237
  action :remove
247
238
  command_name "remove"
248
239
 
249
- option ["--content-view-version-ids"], "VERSION_IDS",
250
- _("Version ids to remove"),
251
- :format => HammerCLI::Options::Normalizers::List.new
252
- option ["--lifecycle-environment-ids"], "LIFECYCLE_ENVIRONMENT_IDS",
253
- _("Environment ids to remove"),
254
- :format => HammerCLI::Options::Normalizers::List.new
255
-
256
240
  def option_sources
257
241
  sources = super
258
242
  sources.find_by_name('IdResolution').insert_relative(
@@ -285,10 +269,15 @@ module HammerCLIKatello
285
269
  command_name 'add-version'
286
270
  desc _('Add a content view version to a composite view')
287
271
 
288
- option "--content-view-id", "CONTENT_VIEW_ID",
289
- _("Content view numeric identifier to search by"),
290
- attribute_name: :option_content_view_id,
291
- format: HammerCLI::Options::Normalizers::Number.new
272
+ option_family do
273
+ parent "--content-view-id", "CONTENT_VIEW_ID",
274
+ _("Content view id to search by"),
275
+ attribute_name: :option_content_view_id,
276
+ format: HammerCLI::Options::Normalizers::Number.new
277
+ child "--content-view", "CONTENT_VIEW_NAME",
278
+ _("Content view name to search by"),
279
+ attribute_name: :option_content_view_name
280
+ end
292
281
 
293
282
  validate_options :before, 'IdResolution' do
294
283
  if option(:option_content_view_version_version).exist?
@@ -358,10 +347,6 @@ module HammerCLIKatello
358
347
 
359
348
  autoload_subcommands
360
349
 
361
- subcommand 'puppet-module',
362
- HammerCLIKatello::ContentViewPuppetModule.desc,
363
- HammerCLIKatello::ContentViewPuppetModule
364
-
365
350
  subcommand HammerCLIKatello::Filter.command_name,
366
351
  HammerCLIKatello::Filter.desc,
367
352
  HammerCLIKatello::Filter
@@ -10,7 +10,7 @@ module HammerCLIKatello
10
10
  include LifecycleEnvironmentNameMapping
11
11
 
12
12
  output do
13
- field :id, _("ID")
13
+ field :id, _("Id")
14
14
  field :name, _("Name")
15
15
  field :version, _("Version")
16
16
  field :description, _("Description")
@@ -35,7 +35,7 @@ module HammerCLIKatello
35
35
  resource :content_view_versions, :show
36
36
 
37
37
  output do
38
- field :id, _("ID")
38
+ field :id, _("Id")
39
39
  field :name, _("Name")
40
40
  field :version, _("Version")
41
41
  field :description, _("Description")
@@ -47,23 +47,16 @@ module HammerCLIKatello
47
47
  end
48
48
 
49
49
  collection :environments, _("Lifecycle Environments") do
50
- field :id, _("ID")
50
+ field :id, _("Id")
51
51
  field :name, _("Name")
52
52
  field :label, _("Label")
53
53
  end
54
54
 
55
55
  collection :repositories, _("Repositories") do
56
- field :id, _("ID")
56
+ field :id, _("Id")
57
57
  field :name, _("Name")
58
58
  field :label, _("Label")
59
59
  end
60
-
61
- collection :puppet_modules, _("Puppet Modules") do
62
- field :id, _("ID")
63
- field :name, _("Name")
64
- field :author, _("Author")
65
- field :version, _("Version")
66
- end
67
60
  end
68
61
 
69
62
  build_options do |o|
@@ -7,7 +7,7 @@ module HammerCLIKatello
7
7
  include LifecycleEnvironmentNameMapping
8
8
 
9
9
  output do
10
- field :id, _("ID")
10
+ field :id, _("Id")
11
11
  field :filename, _("Filename")
12
12
  end
13
13
 
@@ -43,9 +43,9 @@ module HammerCLIKatello
43
43
 
44
44
  class InfoCommand < HammerCLIKatello::InfoCommand
45
45
  output do
46
- field :id, _("ID")
46
+ field :id, _("Id")
47
47
  field :pulp_id, _("Pulp ID")
48
- field :uuid, _("UUID")
48
+ field :uuid, _("Uuid")
49
49
  field :name, _("Name")
50
50
  field :version, _("Version")
51
51
  field :checksum, _("checksum")