hammer_cli_katello 1.1.2 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) 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_units.rb +66 -0
  9. data/lib/hammer_cli_katello/content_view.rb +11 -0
  10. data/lib/hammer_cli_katello/content_view_version.rb +3 -3
  11. data/lib/hammer_cli_katello/host_collection.rb +6 -0
  12. data/lib/hammer_cli_katello/host_errata.rb +2 -3
  13. data/lib/hammer_cli_katello/host_extensions.rb +8 -6
  14. data/lib/hammer_cli_katello/hostgroup_extensions.rb +19 -12
  15. data/lib/hammer_cli_katello/id_resolver.rb +5 -2
  16. data/lib/hammer_cli_katello/option_sources/lifecycle_environment_params.rb +40 -3
  17. data/lib/hammer_cli_katello/organization.rb +28 -3
  18. data/lib/hammer_cli_katello/package.rb +2 -1
  19. data/lib/hammer_cli_katello/ping.rb +7 -0
  20. data/lib/hammer_cli_katello/repository.rb +10 -42
  21. data/lib/hammer_cli_katello/search_options_creators.rb +2 -1
  22. data/lib/hammer_cli_katello/srpm.rb +2 -0
  23. data/lib/hammer_cli_katello/version.rb +1 -1
  24. data/lib/hammer_cli_katello.rb +5 -5
  25. data/test/data/4.3/foreman_api.json +1 -0
  26. data/test/functional/activation_key/create_test.rb +1 -1
  27. data/test/functional/activation_key/subscriptions_test.rb +1 -1
  28. data/test/functional/content_units/info_test.rb +29 -0
  29. data/test/functional/content_units/list_test.rb +106 -0
  30. data/test/functional/content_view/version/promote_test.rb +41 -0
  31. data/test/functional/content_view/version/republish_repositories_test.rb +1 -1
  32. data/test/functional/host/errata/recalculate_test.rb +8 -22
  33. data/test/functional/host_collection/create_test.rb +11 -0
  34. data/test/functional/module_stream/info_test.rb +1 -1
  35. data/test/functional/organization/cdn_configuration_test.rb +42 -0
  36. data/test/functional/organization/info_test.rb +17 -0
  37. data/test/functional/package/list_test.rb +4 -2
  38. data/test/functional/ping_test.rb +3 -1
  39. data/test/functional/srpm/list_test.rb +1 -1
  40. data/test/functional/subscription/list_test.rb +2 -2
  41. data/test/test_helper.rb +1 -1
  42. metadata +14 -8
  43. data/lib/hammer_cli_katello/host_content_source_options.rb +0 -28
  44. data/lib/hammer_cli_katello/host_kickstart_repository_options.rb +0 -49
  45. data/lib/hammer_cli_katello/ostree_branch.rb +0 -34
  46. data/test/functional/repository/export_test.rb +0 -121
@@ -4,7 +4,7 @@ require 'hammer_cli_katello/activation_key'
4
4
  module HammerCLIKatello
5
5
  describe ActivationKeyCommand do
6
6
  describe CreateCommand do
7
- it 'allows promoting a content view' do
7
+ it 'allows activation key creation' do
8
8
  ex = api_expects(:organizations, :index) do |p|
9
9
  p[:search] == "name = \"org1\""
10
10
  end
@@ -36,7 +36,7 @@ module HammerCLIKatello
36
36
  end
37
37
 
38
38
  it 'lists subscriptions used by the activation key' do
39
- api_expects(:subscriptions, :index) { |p| p['activation_key_id'] == 1 }
39
+ api_expects(:subscriptions, :index) { |p| p['activation_key_id'] == '1' }
40
40
  run_cmd(%w(activation-key subscriptions --organization-id 1 --id 1))
41
41
  end
42
42
 
@@ -0,0 +1,29 @@
1
+ require_relative '../test_helper.rb'
2
+ require_relative '../organization/organization_helpers'
3
+ require_relative '../content_view/content_view_helpers'
4
+ require_relative '../repository/repository_helpers'
5
+ require_relative '../product/product_helpers'
6
+ require 'hammer_cli_katello/content_units'
7
+
8
+ module HammerCLIKatello
9
+ describe ContentUnitsCommand::InfoCommand do
10
+ include ContentViewHelpers
11
+ include RepositoryHelpers
12
+ include ProductHelpers
13
+ include OrganizationHelpers
14
+
15
+ it 'allows minimal options' do
16
+ api_expects(:generic_content_units, :show)
17
+ .with_params('content_type' => 'python_package', 'id' => '1492')
18
+
19
+ run_cmd(%w(content-units info --content-type python_package --id 1492))
20
+ end
21
+
22
+ it 'requires content_type param' do
23
+ api_expects_no_call
24
+
25
+ r = run_cmd(%w(content-units info --id 1492))
26
+ assert(r.err.include?("Missing arguments for '--content-type'"), "Invalid error message")
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,106 @@
1
+ require_relative '../test_helper.rb'
2
+ require_relative '../organization/organization_helpers'
3
+ require_relative '../content_view/content_view_helpers'
4
+ require_relative '../repository/repository_helpers'
5
+ require_relative '../product/product_helpers'
6
+ require 'hammer_cli_katello/content_units'
7
+
8
+ module HammerCLIKatello
9
+ describe ContentUnitsCommand::ListCommand do
10
+ include ContentViewHelpers
11
+ include RepositoryHelpers
12
+ include ProductHelpers
13
+ include OrganizationHelpers
14
+
15
+ it 'allows minimal options' do
16
+ api_expects(:generic_content_units, :index)
17
+ .with_params('content_type' => 'python_package')
18
+
19
+ run_cmd(%w(content-units list --content-type python_package))
20
+ end
21
+
22
+ it 'requires content_type param' do
23
+ api_expects_no_call
24
+
25
+ r = run_cmd(%w(content-units list))
26
+ assert(r.err.include?("Missing arguments for '--content-type'"), "Invalid error message")
27
+ end
28
+
29
+ describe 'repository options' do
30
+ it 'may be specified by ID' do
31
+ api_expects(:generic_content_units, :index)
32
+ .with_params('content_type' => 'python_package', 'repository_id' => 1)
33
+
34
+ run_cmd(%w(content-units list --content-type python_package --repository-id 1))
35
+ end
36
+
37
+ it 'require product ID when given repository name' do
38
+ api_expects_no_call
39
+
40
+ r = run_cmd(%w(content-units list --content-type python_package --repository repo1))
41
+ assert(r.err.include?("--product, --product-id is required"), "Invalid error message")
42
+ end
43
+
44
+ # rubocop:disable LineLength
45
+ it 'may be specified by name and product ID' do
46
+ expect_repository_search(2, 'repo1', 1)
47
+
48
+ api_expects(:generic_content_units, :index)
49
+ .with_params('content_type' => 'python_package', 'repository_id' => 1)
50
+ run_cmd(%w(content-units list --content-type python_package --repository repo1 --product-id 2))
51
+ end
52
+ # rubocop:enable LineLength
53
+ end
54
+
55
+ describe 'organization options' do
56
+ it 'may be specified by ID' do
57
+ api_expects(:generic_content_units, :index)
58
+ .with_params('organization_id' => 1, 'content_type' => 'python_package')
59
+
60
+ run_cmd(%w(content-units list --organization-id 1 --content-type python_package))
61
+ end
62
+
63
+ it 'may be specified by name' do
64
+ expect_organization_search('org3', 1)
65
+ api_expects(:generic_content_units, :index)
66
+ .with_params('organization_id' => 1, 'content_type' => 'python_package')
67
+
68
+ run_cmd(%w(content-units list --organization org3 --content-type python_package))
69
+ end
70
+
71
+ it 'may be specified by label' do
72
+ expect_organization_search('org3', 1, field: 'label')
73
+ api_expects(:generic_content_units, :index)
74
+ .with_params('organization_id' => 1, 'content_type' => 'python_package')
75
+
76
+ run_cmd(%w(content-units list --organization-label org3 --content-type python_package))
77
+ end
78
+ end
79
+
80
+ describe 'content-view options' do
81
+ # rubocop:disable LineLength
82
+ it 'may be specified by ID' do
83
+ api_expects(:content_view_versions, :index)
84
+ .with_params('content_view_id' => 1, 'version' => '2.1')
85
+ .returns(index_response([{'id' => 5}]))
86
+ api_expects(:generic_content_units, :index)
87
+ .with_params('content_view_version_id' => 5, 'content_type' => 'python_package')
88
+
89
+ run_cmd(
90
+ %w(
91
+ content-units list --content-view-id 1 --content-view-version 2.1 --content-type python_package
92
+ )
93
+ )
94
+ end
95
+
96
+ it 'requires organization ID when given content view name' do
97
+ api_expects_no_call
98
+
99
+ r = run_cmd(%w(content-units list --content-view cv1 --content-view-version 2.1 --content-type python_package))
100
+ expected_error = "--organization-id, --organization, --organization-label is required"
101
+ assert(r.err.include?(expected_error), "Invalid error message")
102
+ end
103
+ # rubocop:enable LineLength
104
+ end
105
+ end
106
+ end
@@ -30,5 +30,46 @@ module HammerCLIKatello
30
30
  run_cmd(%w(content-view version promote --organization org1 --content-view cv
31
31
  --to-lifecycle-environment test --version 1 --async))
32
32
  end
33
+
34
+ it 'allows promoting a content view without version name/id' do
35
+ ex = api_expects(:organizations, :index) do |p|
36
+ p[:search] == "name = \"org1\""
37
+ end
38
+ ex.at_least_once.returns(index_response([{'id' => 1}]))
39
+
40
+ ex = api_expects(:content_views, :index) do |p|
41
+ p['name'] == 'cv' && p['organization_id'] == 1
42
+ end
43
+ ex.returns(index_response([{'id' => 3}]))
44
+
45
+ ex = api_expects(:content_view_versions, :index) do |p|
46
+ p['content_view_id'] == 3
47
+ end
48
+ ex.returns(
49
+ index_response(
50
+ [
51
+ {'id' => 6, 'name' => 'cv', 'environments' => [{'id' => 1}]},
52
+ {'id' => 7, 'name' => 'cv2', 'environments' => [{'id' => 9}]}
53
+ ]
54
+ )
55
+ )
56
+
57
+ ex = api_expects(:lifecycle_environments, :index) do |p|
58
+ p['organization_id'] == 1 && p['name'] == 'Library'
59
+ end
60
+ ex.returns(index_response([{'id' => 1}]))
61
+
62
+ ex = api_expects(:lifecycle_environments, :index) do |p|
63
+ p['organization_id'] == 1 && p['name'] == 'test'
64
+ end
65
+ ex.returns(index_response([{'id' => 9}]))
66
+
67
+ api_expects(:content_view_versions, :promote) do |p|
68
+ p['id'] == 6 && p['environment_ids'] == [9]
69
+ end
70
+
71
+ run_cmd(%w(content-view version promote --organization org1 --content-view cv
72
+ --to-lifecycle-environment test --from-lifecycle-environment Library --async))
73
+ end
33
74
  end
34
75
  end
@@ -26,7 +26,7 @@ module HammerCLIKatello
26
26
  expect_foreman_task('3')
27
27
 
28
28
  result = run_cmd(%w(content-view version republish-repositories --organization org1
29
- --content-view cv --version 1))
29
+ --content-view cv --version 1 --force true))
30
30
 
31
31
  assert_equal(result.exit_code, 0)
32
32
  end
@@ -8,33 +8,19 @@ describe 'recalculate errata' do
8
8
  end
9
9
 
10
10
  let(:host_id) { 1 }
11
- let(:task_id) { '5' }
12
- let(:response) do
13
- {
14
- 'id' => task_id,
15
- 'state' => 'stopped'
16
- }
17
- end
18
11
 
19
12
  it "recalculates errata for a host" do
20
13
  params = ["--host-id=#{host_id}"]
21
14
 
22
15
  api_expects(:host_errata, :applicability, 'Host errata recalculate')
23
16
  .with_params('host_id' => host_id)
24
- .returns(response)
25
-
26
- expect_foreman_task(task_id)
27
-
28
- run_cmd(@cmd + params)
29
- end
30
-
31
- it "applies an errata to a host with async flag" do
32
- params = ["--host-id=#{host_id}", "--async"]
33
-
34
- api_expects(:host_errata, :applicability, 'Host errata recalculate')
35
- .with_params('host_id' => host_id)
36
- .returns(response)
37
-
38
- run_cmd(@cmd + params)
17
+ .returns({})
18
+
19
+ expected_result = success_result(
20
+ 'Errata recalculation started.
21
+ '
22
+ )
23
+ result = run_cmd(@cmd + params)
24
+ assert_cmd(expected_result, result)
39
25
  end
40
26
  end
@@ -29,6 +29,17 @@ module HammerCLIKatello
29
29
  run_cmd(%w(host-collection create --name hc1 --organization org1))
30
30
  end
31
31
 
32
+ it 'allows unlimited-hosts flag with no arguments' do
33
+ api_expects(:organizations, :index) { |par| par[:search] == "name = \"org1\"" }
34
+ .returns(index_response([{'id' => 1}]))
35
+
36
+ api_expects(:host_collections, :create) do |par|
37
+ par['unlimited_hosts'] == true
38
+ end
39
+
40
+ run_cmd(%w(host-collection create --name hc1 --organization org1 --unlimited-hosts))
41
+ end
42
+
32
43
  it 'allows organization label' do
33
44
  api_expects(:organizations, :index) { |par| par[:search] == "label = \"org1\"" }
34
45
  .returns(index_response([{'id' => 1}]))
@@ -15,7 +15,7 @@ module HammerCLIKatello
15
15
  .returns(index_response([{'id' => 1}]))
16
16
 
17
17
  api_expects(:module_streams, :show)
18
- .with_params(repository_id: "1", id: 1)
18
+ .with_params(repository_id: 1, id: 1)
19
19
 
20
20
  run_cmd(%w(module-stream info --name duck --repository-id 1))
21
21
  end
@@ -0,0 +1,42 @@
1
+ require_relative '../test_helper'
2
+ require 'hammer_cli_katello/organization'
3
+ require 'hammer_cli_katello/associating_commands'
4
+
5
+ describe HammerCLIKatello::Organization::ConfigureCdnCommand do
6
+ include OrganizationHelpers
7
+ before do
8
+ @cmd = %w(organization configure-cdn)
9
+ end
10
+
11
+ it 'by updates with the right params' do
12
+ org_id = '100'
13
+ org_label = 'org1'
14
+ ssl_cred_id = '1'
15
+ password = "pass"
16
+ username = "foo"
17
+ url = "https://goo.com"
18
+ upstream_label = "GreatOrg"
19
+ params = ["--label=#{org_label}",
20
+ "--url=#{url}",
21
+ "--username=#{username}",
22
+ "--upstream-organization-label=#{upstream_label}",
23
+ "--password=#{password}",
24
+ "--ssl-ca-credential-id=#{ssl_cred_id}"
25
+ ]
26
+ expect_organization_search(org_label, org_id, field: 'label')
27
+
28
+ api_expects(:organizations, :cdn_configuration) do |par|
29
+ par['id'].to_s == org_id &&
30
+ par['username'] == username &&
31
+ par['url'] == url &&
32
+ par['password'] == password &&
33
+ par['ssl_ca_credential_id'].to_s == ssl_cred_id &&
34
+ par['upstream_organization_label'] == upstream_label
35
+ end
36
+
37
+ assert_equal(
38
+ 0,
39
+ run_cmd(@cmd + params).exit_code
40
+ )
41
+ end
42
+ end
@@ -19,4 +19,21 @@ describe HammerCLIKatello::Organization::InfoCommand do
19
19
  expected = success_result(FieldMatcher.new('Simple Content Access', 'Enabled'))
20
20
  assert_cmd(expected, result)
21
21
  end
22
+
23
+ it "includes cdn configuration attributes" do
24
+ org_id = 2
25
+ params = ["--id=#{org_id}"]
26
+ api_expects(:organizations, :index).returns(index_response([{'id' => org_id}]))
27
+
28
+ cdn_configuration = {
29
+ "url" => "https://cdn.redhat.com"
30
+ }
31
+
32
+ api_expects(:organizations, :show)
33
+ .with_params('id' => org_id.to_s)
34
+ .returns("cdn_configuration" => cdn_configuration, "id" => org_id)
35
+ result = run_cmd(@cmd + params)
36
+ expected = success_result(FieldMatcher.new('URL', cdn_configuration["url"]))
37
+ assert_cmd(expected, result)
38
+ end
22
39
  end
@@ -24,7 +24,9 @@ module HammerCLIKatello
24
24
  api_expects(:content_view_versions, :index)
25
25
  .with_params('content_view_id' => 1, 'version' => '2.1')
26
26
  .returns(index_response([{'id' => 5}]))
27
- api_expects(:packages, :index).with_params('content_view_version_id' => 5)
27
+ api_expects(:packages, :index)
28
+ .with_params('content_view_version_id' => 5)
29
+ .returns(index_response([{'id' => 1}, {'id' => 2}]))
28
30
 
29
31
  run_cmd(%w(package list --content-view-id 1 --content-view-version 2.1))
30
32
  end
@@ -86,7 +88,7 @@ module HammerCLIKatello
86
88
  it 'may be specified environment name no org fails' do
87
89
  api_expects_no_call
88
90
  r = run_cmd(%w(package list --environment Library))
89
- expec_err = "--organization, --organization-title, --organization-label, --organization-id"
91
+ expec_err = "Missing options to search organization"
90
92
  puts r.err
91
93
  assert(r.err.include?(expec_err), "Invalid error message")
92
94
  end
@@ -15,6 +15,8 @@ describe 'ping' do
15
15
  'katello_events' =>
16
16
  {'status' => 'ok', 'message' => '0 Processed, 0 Failed', 'duration_ms' => '34'},
17
17
  'pulp3' =>
18
+ {'status' => 'ok', 'duration_ms' => '34'},
19
+ 'pulp3_content' =>
18
20
  {'status' => 'ok', 'duration_ms' => '34'}
19
21
  }
20
22
  end
@@ -26,7 +28,7 @@ describe 'ping' do
26
28
  end
27
29
  let(:standard_response_keys) do
28
30
  %w(katello_agent foreman_tasks candlepin candlepin_events
29
- candlepin_auth katello_events pulp3).sort
31
+ candlepin_auth katello_events pulp3 pulp3_content).sort
30
32
  end
31
33
  let(:hammer_ping) { %w(ping katello) }
32
34
 
@@ -6,7 +6,7 @@ require 'hammer_cli_katello/package'
6
6
  require 'hammer_cli_katello/srpm'
7
7
 
8
8
  module HammerCLIKatello
9
- describe PackageCommand::ListCommand do
9
+ describe SrpmCommand::ListCommand do
10
10
  include OrganizationHelpers
11
11
  include RepositoryHelpers
12
12
  include ProductHelpers
@@ -60,7 +60,7 @@ module HammerCLIKatello
60
60
  end
61
61
 
62
62
  it 'allows host id' do
63
- api_expects(:subscriptions, :index) { |par| par['host_id'] == 1 }
63
+ api_expects(:subscriptions, :index) { |par| par['host_id'] == '1' }
64
64
  run_cmd(%w(subscription list --organization-id 1 --host-id 1))
65
65
  end
66
66
 
@@ -72,7 +72,7 @@ module HammerCLIKatello
72
72
  end
73
73
 
74
74
  it 'allows activation key id' do
75
- api_expects(:subscriptions, :index) { |par| par['activation_key_id'] == 1 }
75
+ api_expects(:subscriptions, :index) { |par| par['activation_key_id'] == '1' }
76
76
  run_cmd(%w(subscription list --organization-id 1 --activation-key-id 1))
77
77
  end
78
78
 
data/test/test_helper.rb CHANGED
@@ -17,7 +17,7 @@ require 'minitest/spec'
17
17
  require 'mocha/minitest'
18
18
  require 'hammer_cli'
19
19
 
20
- KATELLO_VERSION = Gem::Version.new(ENV['TEST_API_VERSION'] || '4.1')
20
+ KATELLO_VERSION = Gem::Version.new(ENV['TEST_API_VERSION'] || '4.3')
21
21
 
22
22
  if HammerCLI.context[:api_connection]
23
23
  HammerCLI.context[:api_connection].create('foreman') do
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: 1.1.2
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Price
@@ -35,7 +35,7 @@ authors:
35
35
  autorequire:
36
36
  bindir: bin
37
37
  cert_chain: []
38
- date: 2021-06-01 00:00:00.000000000 Z
38
+ date: 2021-11-29 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: hammer_cli_foreman
@@ -206,6 +206,8 @@ files:
206
206
  - lib/hammer_cli_katello/associating_commands.rb
207
207
  - lib/hammer_cli_katello/capsule.rb
208
208
  - lib/hammer_cli_katello/command_extensions.rb
209
+ - lib/hammer_cli_katello/command_extensions/content_source.rb
210
+ - lib/hammer_cli_katello/command_extensions/kickstart_repository.rb
209
211
  - lib/hammer_cli_katello/command_extensions/lifecycle_environment.rb
210
212
  - lib/hammer_cli_katello/command_extensions/lifecycle_environments.rb
211
213
  - lib/hammer_cli_katello/command_extensions/ping.rb
@@ -218,6 +220,7 @@ files:
218
220
  - lib/hammer_cli_katello/content_export_incremental.rb
219
221
  - lib/hammer_cli_katello/content_import.rb
220
222
  - lib/hammer_cli_katello/content_override.rb
223
+ - lib/hammer_cli_katello/content_units.rb
221
224
  - lib/hammer_cli_katello/content_view.rb
222
225
  - lib/hammer_cli_katello/content_view_component.rb
223
226
  - lib/hammer_cli_katello/content_view_name_resolvable.rb
@@ -239,11 +242,9 @@ files:
239
242
  - lib/hammer_cli_katello/host_collection_erratum.rb
240
243
  - lib/hammer_cli_katello/host_collection_package.rb
241
244
  - lib/hammer_cli_katello/host_collection_package_group.rb
242
- - lib/hammer_cli_katello/host_content_source_options.rb
243
245
  - lib/hammer_cli_katello/host_deb.rb
244
246
  - lib/hammer_cli_katello/host_errata.rb
245
247
  - lib/hammer_cli_katello/host_extensions.rb
246
- - lib/hammer_cli_katello/host_kickstart_repository_options.rb
247
248
  - lib/hammer_cli_katello/host_package.rb
248
249
  - lib/hammer_cli_katello/host_package_group.rb
249
250
  - lib/hammer_cli_katello/host_subscription.rb
@@ -262,7 +263,6 @@ files:
262
263
  - lib/hammer_cli_katello/option_sources/lifecycle_environment_params.rb
263
264
  - lib/hammer_cli_katello/organization.rb
264
265
  - lib/hammer_cli_katello/organization_options.rb
265
- - lib/hammer_cli_katello/ostree_branch.rb
266
266
  - lib/hammer_cli_katello/output/fields.rb
267
267
  - lib/hammer_cli_katello/output/formatters.rb
268
268
  - lib/hammer_cli_katello/package.rb
@@ -317,6 +317,7 @@ files:
317
317
  - test/data/3.9/foreman_api.json
318
318
  - test/data/4.0/foreman_api.json
319
319
  - test/data/4.1/foreman_api.json
320
+ - test/data/4.3/foreman_api.json
320
321
  - test/data/Readme.md
321
322
  - test/functional/activation_key/add_host_collection_test.rb
322
323
  - test/functional/activation_key/content_override_test.rb
@@ -357,6 +358,8 @@ files:
357
358
  - test/functional/content_import/list_test.rb
358
359
  - test/functional/content_import/metadata.json
359
360
  - test/functional/content_import/version_test.rb
361
+ - test/functional/content_units/info_test.rb
362
+ - test/functional/content_units/list_test.rb
360
363
  - test/functional/content_view/add_content_view_version_test.rb
361
364
  - test/functional/content_view/add_repository_test.rb
362
365
  - test/functional/content_view/component/add_test.rb
@@ -439,6 +442,7 @@ files:
439
442
  - test/functional/local_helper_test.rb
440
443
  - test/functional/module_stream/info_test.rb
441
444
  - test/functional/module_stream/list_test.rb
445
+ - test/functional/organization/cdn_configuration_test.rb
442
446
  - test/functional/organization/delete_test.rb
443
447
  - test/functional/organization/info_test.rb
444
448
  - test/functional/organization/organization_helpers.rb
@@ -456,7 +460,6 @@ files:
456
460
  - test/functional/product/update_test.rb
457
461
  - test/functional/repository/create_test.rb
458
462
  - test/functional/repository/delete_test.rb
459
- - test/functional/repository/export_test.rb
460
463
  - test/functional/repository/info_test.rb
461
464
  - test/functional/repository/list_test.rb
462
465
  - test/functional/repository/remove_content_test.rb
@@ -507,7 +510,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
507
510
  - !ruby/object:Gem::Version
508
511
  version: '0'
509
512
  requirements: []
510
- rubygems_version: 3.1.2
513
+ rubygems_version: 3.1.6
511
514
  signing_key:
512
515
  specification_version: 4
513
516
  summary: Katello commands for Hammer
@@ -533,6 +536,7 @@ test_files:
533
536
  - test/data/3.9/foreman_api.json
534
537
  - test/data/4.0/foreman_api.json
535
538
  - test/data/4.1/foreman_api.json
539
+ - test/data/4.3/foreman_api.json
536
540
  - test/data/Readme.md
537
541
  - test/functional/activation_key/add_host_collection_test.rb
538
542
  - test/functional/activation_key/content_override_test.rb
@@ -573,6 +577,8 @@ test_files:
573
577
  - test/functional/content_import/list_test.rb
574
578
  - test/functional/content_import/metadata.json
575
579
  - test/functional/content_import/version_test.rb
580
+ - test/functional/content_units/info_test.rb
581
+ - test/functional/content_units/list_test.rb
576
582
  - test/functional/content_view/add_content_view_version_test.rb
577
583
  - test/functional/content_view/add_repository_test.rb
578
584
  - test/functional/content_view/component/add_test.rb
@@ -655,6 +661,7 @@ test_files:
655
661
  - test/functional/local_helper_test.rb
656
662
  - test/functional/module_stream/info_test.rb
657
663
  - test/functional/module_stream/list_test.rb
664
+ - test/functional/organization/cdn_configuration_test.rb
658
665
  - test/functional/organization/delete_test.rb
659
666
  - test/functional/organization/info_test.rb
660
667
  - test/functional/organization/organization_helpers.rb
@@ -672,7 +679,6 @@ test_files:
672
679
  - test/functional/product/update_test.rb
673
680
  - test/functional/repository/create_test.rb
674
681
  - test/functional/repository/delete_test.rb
675
- - test/functional/repository/export_test.rb
676
682
  - test/functional/repository/info_test.rb
677
683
  - test/functional/repository/list_test.rb
678
684
  - test/functional/repository/remove_content_test.rb
@@ -1,28 +0,0 @@
1
- module HammerCLIKatello
2
- module HostContentSourceOptions
3
- def self.included(base)
4
- base.option "--content-source", "CONTENT_SOURCE_NAME",
5
- _("Content Source name "),
6
- :attribute_name => :option_content_source
7
- end
8
-
9
- def request_params
10
- super.tap do |mod|
11
- resource_name = resource.singular_name
12
- if option_content_source && !option_content_source_id
13
- resource_hash = if resource_name == "hostgroup"
14
- mod[resource_name]
15
- else
16
- mod[resource_name]["content_facet_attributes"]
17
- end
18
-
19
- proxy_options = { HammerCLI.option_accessor_name('name') => option_content_source}
20
- resource_hash["content_source_id"] = resolver.smart_proxy_id(proxy_options)
21
- end
22
- end
23
- rescue HammerCLIForeman::ResolverError => e
24
- e.message.gsub!('smart_proxy', _('Content Source'))
25
- raise e
26
- end
27
- end
28
- end
@@ -1,49 +0,0 @@
1
- module HammerCLIKatello
2
- module HostKickstartRepositoryOptions
3
- def self.included(base)
4
- base.option "--kickstart-repository", "REPOSITORY_NAME",
5
- _("Kickstart repository name "),
6
- :attribute_name => :option_kickstart_repository
7
- end
8
-
9
- def request_params
10
- super.tap do |mod|
11
- resource_name = resource.singular_name
12
- if option_kickstart_repository && !option_kickstart_repository_id
13
- resource_hash = if resource_name == "hostgroup"
14
- mod[resource_name]
15
- else
16
- mod[resource_name]["content_facet_attributes"]
17
- end
18
-
19
- resource_hash ||= {}
20
-
21
- env_id = resource_hash["lifecycle_environment_id"]
22
- cv_id = resource_hash["content_view_id"]
23
-
24
- raise _("Please provide --lifecycle-environment-id") unless env_id
25
-
26
- raise _("Please provide --content-view-id") unless cv_id
27
-
28
- resource_hash["kickstart_repository_id"] = fetch_repo_id(cv_id, env_id,
29
- option_kickstart_repository)
30
- end
31
- end
32
- end
33
-
34
- def 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
@@ -1,34 +0,0 @@
1
- module HammerCLIKatello
2
- class OstreeBranchCommand < HammerCLIKatello::Command
3
- resource :ostree_branches
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 :version, _("version")
14
- end
15
-
16
- build_options do |o|
17
- o.expand.including(:products, :organizations, :content_views)
18
- end
19
- end
20
-
21
- class InfoCommand < HammerCLIKatello::InfoCommand
22
- output do
23
- field :id, _("Id")
24
- field :name, _("Name")
25
- field :version, _("Version")
26
- field :commit, _("Commit")
27
- end
28
-
29
- build_options
30
- end
31
-
32
- autoload_subcommands
33
- end
34
- end