hammer_cli_katello 0.24.4 → 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/activation_key.rb +5 -5
  3. data/lib/hammer_cli_katello/capsule.rb +2 -3
  4. data/lib/hammer_cli_katello/command_extensions/lifecycle_environment.rb +10 -7
  5. data/lib/hammer_cli_katello/command_extensions/lifecycle_environments.rb +11 -8
  6. data/lib/hammer_cli_katello/content_credential.rb +20 -19
  7. data/lib/hammer_cli_katello/content_export.rb +1 -0
  8. data/lib/hammer_cli_katello/content_export_helper.rb +1 -1
  9. data/lib/hammer_cli_katello/content_view.rb +16 -31
  10. data/lib/hammer_cli_katello/content_view_version.rb +5 -13
  11. data/lib/hammer_cli_katello/deb_package.rb +3 -3
  12. data/lib/hammer_cli_katello/erratum.rb +1 -1
  13. data/lib/hammer_cli_katello/erratum_info_command.rb +1 -1
  14. data/lib/hammer_cli_katello/file.rb +3 -3
  15. data/lib/hammer_cli_katello/filter.rb +2 -2
  16. data/lib/hammer_cli_katello/foreman_search_options_creators.rb +0 -12
  17. data/lib/hammer_cli_katello/host_collection.rb +2 -2
  18. data/lib/hammer_cli_katello/host_deb.rb +1 -1
  19. data/lib/hammer_cli_katello/host_errata.rb +1 -1
  20. data/lib/hammer_cli_katello/host_extensions.rb +5 -5
  21. data/lib/hammer_cli_katello/host_package.rb +1 -1
  22. data/lib/hammer_cli_katello/hostgroup_extensions.rb +4 -4
  23. data/lib/hammer_cli_katello/id_resolver.rb +0 -5
  24. data/lib/hammer_cli_katello/lifecycle_environment.rb +2 -2
  25. data/lib/hammer_cli_katello/module_stream.rb +8 -8
  26. data/lib/hammer_cli_katello/organization_options.rb +8 -6
  27. data/lib/hammer_cli_katello/ostree_branch.rb +2 -2
  28. data/lib/hammer_cli_katello/package.rb +5 -5
  29. data/lib/hammer_cli_katello/package_group.rb +4 -4
  30. data/lib/hammer_cli_katello/ping.rb +0 -14
  31. data/lib/hammer_cli_katello/product.rb +3 -3
  32. data/lib/hammer_cli_katello/product_content.rb +2 -2
  33. data/lib/hammer_cli_katello/repository.rb +6 -37
  34. data/lib/hammer_cli_katello/repository_set.rb +4 -4
  35. data/lib/hammer_cli_katello/simple_content_access.rb +40 -0
  36. data/lib/hammer_cli_katello/srpm.rb +2 -2
  37. data/lib/hammer_cli_katello/subscription.rb +2 -3
  38. data/lib/hammer_cli_katello/sync_plan.rb +2 -2
  39. data/lib/hammer_cli_katello/version.rb +1 -1
  40. data/lib/hammer_cli_katello.rb +6 -14
  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 +9 -9
  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 +16 -18
  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: 1b1afcbfac0dd2680c3e26164a1068e6993bc276d9599441747ddd58f637f7d1
4
- data.tar.gz: 4f7971c7d6e6145e800f055302d2420e0f37b1832044a0664c00c8061193376b
3
+ metadata.gz: 6a4a20566a58ddf6462ecdc274f1d4f7e107c482ac79ab93b42db2ab11b6d45e
4
+ data.tar.gz: 6ad63b1d4e551613de6508c34f137f835934c34731e6dcbb18e69a20b51d421a
5
5
  SHA512:
6
- metadata.gz: 91adf0f28b5056ca429c5449e02556635d6e1217279f53cf7551c3f7fab0309a57f002a620e7cf88384936919970f7aabffddf23613953adbd3727359351bcc0
7
- data.tar.gz: 6049debd76cb92fcb3309438d7c79d976e5b5f252689d5578268f91196a421fb8d9d8a30ca782a489ed60a7692b556849521a1ef3c93a376f208148dd3aac517
6
+ metadata.gz: 179e73dd5c1186e82ff0265cb7eeb36f1a86daee9b2fe915d9cb3fe855ae62420601d2f7ca3adb153d70ffaadaa492be3086ecf129ed17b9435441d8727ac2e1
7
+ data.tar.gz: 8918cf5f6376226d4cecd99a70dbadd59d3a7ba2d029517a06849e3f89a9e94b0ea5a76ce46edb60847ceb64b2dcf0af0724a86530541231cf0ae22fa2d2c593
@@ -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|
@@ -494,8 +487,7 @@ module HammerCLIKatello
494
487
  library_repos = index(
495
488
  :repositories,
496
489
  'organization_id' => organization_id,
497
- 'library' => true,
498
- 'label' => repo['label']
490
+ 'library' => true
499
491
  )
500
492
 
501
493
  library_repo = library_repos.select do |candidate_repo|
@@ -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")
@@ -10,7 +10,7 @@ module HammerCLIKatello
10
10
  validate_repo_name_requires_product_options(:option_repository_name)
11
11
 
12
12
  output do
13
- field :id, _("ID")
13
+ field :id, _("Id")
14
14
  field :errata_id, _("Errata ID")
15
15
  field :type, _("Type")
16
16
  field :title, _("Title")
@@ -7,7 +7,7 @@ module HammerCLIKatello
7
7
  field :version, _("Version")
8
8
  field :description, _("Description")
9
9
  field :status, _("Status")
10
- field :id, _("ID")
10
+ field :id, _("Id")
11
11
  field :errata_id, _("Errata ID")
12
12
  field :reboot_suggested, _("Reboot Suggested")
13
13
  field :updated, _("Updated")
@@ -8,7 +8,7 @@ module HammerCLIKatello
8
8
  validate_repo_name_requires_product_options(:option_repository_name)
9
9
 
10
10
  output do
11
- field :id, _("ID")
11
+ field :id, _("Id")
12
12
  field :name, _("Name")
13
13
  field :path, _("Path")
14
14
  end
@@ -28,10 +28,10 @@ module HammerCLIKatello
28
28
 
29
29
  class InfoCommand < HammerCLIKatello::InfoCommand
30
30
  output do
31
- field :id, _("ID")
31
+ field :id, _("Id")
32
32
  field :name, _("Name")
33
33
  field :path, _("Path")
34
- field :uuid, _("UUID")
34
+ field :uuid, _("Uuid")
35
35
  field :checksum, _("Checksum")
36
36
  end
37
37