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
@@ -1,59 +0,0 @@
1
- module HammerCLIKatello
2
- class PuppetModule < HammerCLIKatello::Command
3
- resource :puppet_modules
4
-
5
- class ListCommand < HammerCLIKatello::ListCommand
6
- extend RepositoryScopedToProduct
7
-
8
- validate_repo_name_requires_product_options(:option_repository_name)
9
-
10
- output do
11
- field :id, _("ID")
12
- field :name, _("Name")
13
- field :author, _("Author")
14
- field :version, _("Version")
15
- field :uuid, _("Uuid")
16
- end
17
-
18
- build_options do |o|
19
- o.expand(:all).including(:organizations, :products, :content_views)
20
- end
21
- end
22
-
23
- class InfoCommand < HammerCLIKatello::InfoCommand
24
- output do
25
- field :id, _("ID")
26
- field :name, _("Name")
27
- field :version, _("Version")
28
- field :author, _("Author")
29
- field :uuid, _("Uuid")
30
-
31
- field :summary, _("Summary")
32
- field :description, _("Description")
33
- field :license, _("License")
34
- field :project_page, _("Project Page")
35
- field :source, _("Source")
36
-
37
- collection :dependencies, _("Dependencies"), :numbered => false do
38
- field nil, nil, HammerCLIKatello::Output::Fields::Dependency
39
- end
40
- collection :checksums, _("File checksums"), :numbered => false do
41
- field nil, nil, HammerCLIKatello::Output::Fields::ChecksumFilePair
42
- end
43
-
44
- field :tag_list, _("Tag List"), Fields::List
45
-
46
- collection :repositories, _("Repositories") do
47
- field :id, _("Id")
48
- field :name, _("Name")
49
- end
50
- end
51
-
52
- build_options do |o|
53
- o.expand(:all).including(:organizations)
54
- end
55
- end
56
-
57
- autoload_subcommands
58
- end
59
- end
@@ -1,24 +0,0 @@
1
- require_relative '../../test_helper'
2
- require 'hammer_cli_katello/content_view_puppet_module'
3
-
4
- module HammerCLIKatello
5
- describe ContentViewPuppetModule do
6
- it 'allows adding a puppet module' do
7
- ex = api_expects(:organizations, :index) do |p|
8
- p[:search] == "name = \"org1\""
9
- end
10
- ex.returns(index_response([{'id' => 1}]))
11
-
12
- ex = api_expects(:content_views, :index) do |p|
13
- p['name'] == 'cv' && p['organization_id'] == 1
14
- end
15
- ex.returns(index_response([{'id' => 3}]))
16
-
17
- api_expects(:content_view_puppet_modules, :create) do |p|
18
- p['content_view_id'] == 3
19
- end
20
-
21
- run_cmd(%w(content-view puppet-module add --organization org1 --content-view cv --id 1))
22
- end
23
- end
24
- end
@@ -1,54 +0,0 @@
1
- require_relative '../../test_helper'
2
- require_relative '../../content_view/content_view_helpers'
3
- require_relative '../../organization/organization_helpers'
4
- require 'hammer_cli_katello/content_view_puppet_module'
5
-
6
- module HammerCLIKatello
7
- describe ContentViewPuppetModule::DeleteCommand do
8
- include ContentViewHelpers
9
- include OrganizationHelpers
10
-
11
- def expect_module_destroy(opts)
12
- api_expects(:content_view_puppet_modules, :destroy).with_params(opts[:params])
13
- end
14
-
15
- it 'allows minimal options' do
16
- expect_module_destroy(params: {'content_view_id' => 1, 'id' => 2})
17
-
18
- run_cmd(%w(content-view puppet-module remove --content-view-id 1 --id 2))
19
- end
20
-
21
- it 'resolves puppet module ID from UUID' do
22
- expect_generic_search(:content_view_puppet_modules,
23
- params: {'uuid' => 'abcd1234', 'content_view_id' => 1},
24
- returns: {'id' => 2})
25
- expect_module_destroy(params: {'content_view_id' => 1, 'id' => 2})
26
-
27
- run_cmd(%w(content-view puppet-module remove --content-view-id 1 --uuid abcd1234))
28
- end
29
-
30
- it 'resolves content view ID from name' do
31
- expect_content_view_search('3', 'cv1', 1)
32
- expect_module_destroy(params: {'content_view_id' => 1, 'id' => 2})
33
-
34
- run_cmd(%w(content-view puppet-module remove --content-view cv1 --organization-id 3 --id 2))
35
- end
36
-
37
- it 'resolves organization ID from name' do
38
- expect_organization_search('org3', 3)
39
- expect_content_view_search(3, 'cv1', 1)
40
- expect_module_destroy(params: {'content_view_id' => 1, 'id' => 2})
41
-
42
- run_cmd(%w(content-view puppet-module remove --content-view cv1 --organization org3 --id 2))
43
- end
44
-
45
- it 'resolves organization ID from label' do
46
- expect_organization_search('org3', 3, field: 'label')
47
- expect_content_view_search(3, 'cv1', 1)
48
- expect_module_destroy(params: {'content_view_id' => 1, 'id' => 2})
49
-
50
- run_cmd(%w(content-view puppet-module remove --content-view cv1 --organization-label
51
- org3 --id 2))
52
- end
53
- end
54
- end
@@ -1,39 +0,0 @@
1
- require_relative 'test_helper'
2
- require 'hammer_cli_katello/gpg_key'
3
-
4
- module HammerCLIKatello
5
- describe GpgKeyCommand::ListCommand do
6
- it 'warns of deprecation' do
7
- result = run_cmd(%w(gpg list))
8
- assert_match(/deprecated/, result.err)
9
- end
10
- end
11
-
12
- describe GpgKeyCommand::InfoCommand do
13
- it 'warns of deprecation' do
14
- result = run_cmd(%w(gpg info))
15
- assert_match(/deprecated/, result.err)
16
- end
17
- end
18
-
19
- describe GpgKeyCommand::CreateCommand do
20
- it 'warns of deprecation' do
21
- result = run_cmd(%w(gpg create))
22
- assert_match(/deprecated/, result.err)
23
- end
24
- end
25
-
26
- describe GpgKeyCommand::UpdateCommand do
27
- it 'warns of deprecation' do
28
- result = run_cmd(%w(gpg update))
29
- assert_match(/deprecated/, result.err)
30
- end
31
- end
32
-
33
- describe GpgKeyCommand::DeleteCommand do
34
- it 'warns of deprecation' do
35
- result = run_cmd(%w(gpg delete))
36
- assert_match(/deprecated/, result.err)
37
- end
38
- end
39
- end
@@ -1,43 +0,0 @@
1
- {
2
- "name":"test_ca",
3
- "content_type":"cert",
4
- "content":"hi",
5
- "id":1,
6
- "organization_id":1,
7
- "organization":{
8
- "name":"org2",
9
- "label":"org2",
10
- "id":1
11
- },
12
- "created_at":"2020-01-28 09:30:54 -0500",
13
- "updated_at":"2020-01-28 09:30:54 -0500",
14
- "gpg_key_products":[
15
-
16
- ],
17
- "gpg_key_repos":[
18
-
19
- ],
20
- "ssl_ca_products":[
21
-
22
- ],
23
- "ssl_ca_root_repos":[
24
-
25
- ],
26
- "ssl_client_products":[
27
-
28
- ],
29
- "ssl_client_root_repos":[
30
-
31
- ],
32
- "ssl_key_products":[
33
-
34
- ],
35
- "ssl_key_root_repos":[
36
-
37
- ],
38
- "permissions":{
39
- "view_content_credenials":true,
40
- "edit_content_credenials":true,
41
- "destroy_content_credenials":true
42
- }
43
- }
@@ -1,43 +0,0 @@
1
- {
2
- "name":"test_key",
3
- "content_type":"cert",
4
- "content":"hi again",
5
- "id":3,
6
- "organization_id":1,
7
- "organization":{
8
- "name":"org2",
9
- "label":"org2",
10
- "id":1
11
- },
12
- "created_at":"2020-01-28 09:31:05 -0500",
13
- "updated_at":"2020-01-28 09:31:05 -0500",
14
- "gpg_key_products":[
15
-
16
- ],
17
- "gpg_key_repos":[
18
-
19
- ],
20
- "ssl_ca_products":[
21
-
22
- ],
23
- "ssl_ca_root_repos":[
24
-
25
- ],
26
- "ssl_client_products":[
27
-
28
- ],
29
- "ssl_client_root_repos":[
30
-
31
- ],
32
- "ssl_key_products":[
33
-
34
- ],
35
- "ssl_key_root_repos":[
36
-
37
- ],
38
- "permissions":{
39
- "view_content_credenials":true,
40
- "edit_content_credenials":true,
41
- "destroy_content_credenials":true
42
- }
43
- }