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.
- checksums.yaml +4 -4
- data/lib/hammer_cli_katello.rb +6 -14
- data/lib/hammer_cli_katello/activation_key.rb +5 -5
- data/lib/hammer_cli_katello/capsule.rb +2 -3
- data/lib/hammer_cli_katello/command_extensions/lifecycle_environment.rb +10 -7
- data/lib/hammer_cli_katello/command_extensions/lifecycle_environments.rb +11 -8
- data/lib/hammer_cli_katello/content_credential.rb +20 -19
- data/lib/hammer_cli_katello/content_export.rb +1 -0
- data/lib/hammer_cli_katello/content_export_helper.rb +1 -1
- data/lib/hammer_cli_katello/content_view.rb +16 -31
- data/lib/hammer_cli_katello/content_view_version.rb +4 -11
- data/lib/hammer_cli_katello/deb_package.rb +3 -3
- data/lib/hammer_cli_katello/erratum.rb +1 -1
- data/lib/hammer_cli_katello/erratum_info_command.rb +1 -1
- data/lib/hammer_cli_katello/file.rb +3 -3
- data/lib/hammer_cli_katello/filter.rb +2 -2
- data/lib/hammer_cli_katello/foreman_search_options_creators.rb +0 -12
- data/lib/hammer_cli_katello/host_collection.rb +2 -2
- data/lib/hammer_cli_katello/host_deb.rb +1 -1
- data/lib/hammer_cli_katello/host_errata.rb +1 -1
- data/lib/hammer_cli_katello/host_extensions.rb +5 -5
- data/lib/hammer_cli_katello/host_package.rb +1 -1
- data/lib/hammer_cli_katello/hostgroup_extensions.rb +4 -4
- data/lib/hammer_cli_katello/id_resolver.rb +5 -6
- data/lib/hammer_cli_katello/lifecycle_environment.rb +2 -2
- data/lib/hammer_cli_katello/module_stream.rb +8 -8
- data/lib/hammer_cli_katello/organization_options.rb +8 -6
- data/lib/hammer_cli_katello/ostree_branch.rb +2 -2
- data/lib/hammer_cli_katello/package.rb +5 -5
- data/lib/hammer_cli_katello/package_group.rb +4 -4
- data/lib/hammer_cli_katello/ping.rb +0 -14
- data/lib/hammer_cli_katello/product.rb +3 -3
- data/lib/hammer_cli_katello/product_content.rb +2 -2
- data/lib/hammer_cli_katello/repository.rb +6 -37
- data/lib/hammer_cli_katello/repository_set.rb +4 -4
- data/lib/hammer_cli_katello/simple_content_access.rb +40 -0
- data/lib/hammer_cli_katello/srpm.rb +2 -2
- data/lib/hammer_cli_katello/subscription.rb +2 -3
- data/lib/hammer_cli_katello/sync_plan.rb +2 -2
- data/lib/hammer_cli_katello/version.rb +1 -1
- data/test/data/3.18/foreman_api.json +1 -1
- data/test/data/3.19/foreman_api.json +1 -0
- data/test/data/4.0/foreman_api.json +1 -0
- data/test/functional/capsule/content/info_test.rb +1 -2
- data/test/functional/content_credentials/create_test.rb +32 -0
- data/test/functional/{repository → content_credentials}/data/test_cert.json +0 -0
- data/test/functional/content_credentials/list_test.rb +6 -8
- data/test/functional/content_export/list_test.rb +33 -3
- data/test/functional/content_view/list_test.rb +0 -2
- data/test/functional/content_view/publish_test.rb +0 -21
- data/test/functional/content_view/version/promote_test.rb +1 -2
- data/test/functional/content_view/version/republish_repositories_test.rb +1 -2
- data/test/functional/host/errata/apply_test.rb +0 -2
- data/test/functional/host/errata/recalculate_test.rb +0 -2
- data/test/functional/ping_test.rb +0 -2
- data/test/functional/repository/create_test.rb +0 -30
- data/test/functional/repository/info_test.rb +4 -4
- data/test/functional/repository/list_test.rb +0 -2
- data/test/functional/simple_content_access/disable_test.rb +48 -0
- data/test/functional/simple_content_access/enable_test.rb +46 -0
- data/test/test_helper.rb +1 -1
- metadata +15 -17
- data/lib/hammer_cli_katello/content_view_puppet_module.rb +0 -60
- data/lib/hammer_cli_katello/gpg_key.rb +0 -67
- data/lib/hammer_cli_katello/puppet_module.rb +0 -59
- data/test/functional/content_view/puppet_module/add_test.rb +0 -24
- data/test/functional/content_view/puppet_module/remove_test.rb +0 -54
- data/test/functional/gpg_test.rb +0 -39
- data/test/functional/repository/data/test_ca.json +0 -43
- data/test/functional/repository/data/test_key.json +0 -43
@@ -11,8 +11,6 @@ describe 'ping' do
|
|
11
11
|
'candlepin_events' => {'status' => 'ok', 'message' => '0 messages', 'duration_ms' => '34'},
|
12
12
|
'candlepin_auth' => {'status' => 'ok', 'duration_ms' => '34'},
|
13
13
|
'katello_events' => {'status' => 'ok', 'message' => '0 messages', 'duration_ms' => '34'},
|
14
|
-
'pulp' => {'status' => 'ok', 'duration_ms' => '34'},
|
15
|
-
'pulp_auth' => {'status' => 'ok', 'duration_ms' => '34'},
|
16
14
|
'pulp3' => {'status' => 'ok', 'duration_ms' => '34'}
|
17
15
|
}
|
18
16
|
)
|
@@ -18,34 +18,4 @@ describe "create repository" do
|
|
18
18
|
|
19
19
|
assert_equal(0, run_cmd(command).exit_code)
|
20
20
|
end
|
21
|
-
|
22
|
-
it 'with ssl options by name' do
|
23
|
-
def stub_gpg_key(gpg_key_name)
|
24
|
-
gpg_key_index = api_expects(:gpg_keys, :index)
|
25
|
-
.with_params(
|
26
|
-
name: gpg_key_name.to_s,
|
27
|
-
organization_id: 1,
|
28
|
-
per_page: 1000,
|
29
|
-
page: 1)
|
30
|
-
gpg_response = File.join(File.dirname(__FILE__), 'data', "#{gpg_key_name}.json")
|
31
|
-
gpg_key_index.returns(JSON.parse(File.read(gpg_response)))
|
32
|
-
end
|
33
|
-
|
34
|
-
api_expects(:repositories, :create)
|
35
|
-
.with_params(
|
36
|
-
name: name,
|
37
|
-
product_id: product_id,
|
38
|
-
ssl_ca_cert_id: 1,
|
39
|
-
ssl_client_cert_id: 2,
|
40
|
-
ssl_client_key_id: 3,
|
41
|
-
content_type: content_type)
|
42
|
-
|
43
|
-
%w(test_cert test_key test_ca).each { |cred| stub_gpg_key(cred) }
|
44
|
-
|
45
|
-
command = %W(repository create --organization-id #{org_id} --product-id #{product_id}
|
46
|
-
--content-type #{content_type} --name #{name} --ssl-client-cert test_cert
|
47
|
-
--ssl-client-key test_key --ssl-ca-cert test_ca)
|
48
|
-
|
49
|
-
assert_equal(0, run_cmd(command).exit_code)
|
50
|
-
end
|
51
21
|
end
|
@@ -46,7 +46,7 @@ describe "get repository info" do
|
|
46
46
|
)
|
47
47
|
result = run_cmd(@cmd + params)
|
48
48
|
# rubocop:disable Style/WordArray
|
49
|
-
expected_fields = [['
|
49
|
+
expected_fields = [['Id', '1'],
|
50
50
|
['Name', 'Test Repo'],
|
51
51
|
['Label', 'Test_Repo'],
|
52
52
|
['Description', 'hammertime'],
|
@@ -59,7 +59,7 @@ describe "get repository info" do
|
|
59
59
|
['Download Policy', 'immediate'],
|
60
60
|
['HTTP Proxy', ''],
|
61
61
|
['Product', ''],
|
62
|
-
['
|
62
|
+
['Id', '79'],
|
63
63
|
['Name', 'test'],
|
64
64
|
['GPG Key', ''],
|
65
65
|
['Sync', ''],
|
@@ -122,7 +122,7 @@ describe "get repository info" do
|
|
122
122
|
)
|
123
123
|
result = run_cmd(@cmd + params)
|
124
124
|
# rubocop:disable Style/WordArray
|
125
|
-
expected_fields = [['
|
125
|
+
expected_fields = [['Id', '1'],
|
126
126
|
['Name', 'Test Repo'],
|
127
127
|
['Label', 'Test_Repo'],
|
128
128
|
['Description', 'hammertime'],
|
@@ -135,7 +135,7 @@ describe "get repository info" do
|
|
135
135
|
['Download Policy', 'immediate'],
|
136
136
|
['HTTP Proxy', ''],
|
137
137
|
['Product', ''],
|
138
|
-
['
|
138
|
+
['Id', '79'],
|
139
139
|
['Name', 'Test_Product'],
|
140
140
|
['GPG Key', ''],
|
141
141
|
['Sync', ''],
|
@@ -1,8 +1,6 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), '../test_helper')
|
2
2
|
require File.join(File.dirname(__FILE__), '../lifecycle_environment/lifecycle_environment_helpers')
|
3
3
|
|
4
|
-
require 'hammer_cli_katello/content_view_puppet_module'
|
5
|
-
|
6
4
|
describe 'listing repositories' do
|
7
5
|
include LifecycleEnvironmentHelpers
|
8
6
|
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '../../test_helper')
|
2
|
+
|
3
|
+
describe 'simple-content-access disable' do
|
4
|
+
before do
|
5
|
+
@cmd = %w(simple-content-access disable)
|
6
|
+
end
|
7
|
+
|
8
|
+
let(:organization_id) { 3 }
|
9
|
+
|
10
|
+
it "disables with required options" do
|
11
|
+
params = ["--organization-id=#{organization_id}"]
|
12
|
+
|
13
|
+
api_expects(:simple_content_access, :eligible).
|
14
|
+
with_params('organization_id' => organization_id).
|
15
|
+
returns("simple_content_access_eligible" => true)
|
16
|
+
|
17
|
+
api_expects(:simple_content_access, :disable)
|
18
|
+
.with_params('organization_id' => organization_id)
|
19
|
+
run_cmd(@cmd + params)
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'fails on missing required params' do
|
23
|
+
params = []
|
24
|
+
|
25
|
+
result = run_cmd(@cmd + params)
|
26
|
+
expected_error = "Could not disable Simple Content Access for this organization"
|
27
|
+
|
28
|
+
assert_equal(result.exit_code, HammerCLI::EX_SOFTWARE)
|
29
|
+
assert_equal(result.err[/#{expected_error}/], expected_error)
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'fails on non eligible org' do
|
33
|
+
params = ["--organization-id=#{organization_id}"]
|
34
|
+
|
35
|
+
api_expects(:simple_content_access, :eligible).
|
36
|
+
with_params('organization_id' => organization_id).
|
37
|
+
returns("simple_content_access_eligible" => false)
|
38
|
+
|
39
|
+
api_expects(:simple_content_access, :disable)
|
40
|
+
.with_params('organization_id' => organization_id).never
|
41
|
+
result = run_cmd(@cmd + params)
|
42
|
+
|
43
|
+
expected_error = "Could not disable Simple Content Access for this organization"
|
44
|
+
|
45
|
+
assert_equal(result.exit_code, HammerCLI::EX_SOFTWARE)
|
46
|
+
assert_equal(result.err[/#{expected_error}/], expected_error)
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '../../test_helper')
|
2
|
+
|
3
|
+
describe 'simple-content-access enable' do
|
4
|
+
before do
|
5
|
+
@cmd = %w(simple-content-access enable)
|
6
|
+
end
|
7
|
+
|
8
|
+
let(:organization_id) { 3 }
|
9
|
+
|
10
|
+
it "enables with required options" do
|
11
|
+
params = ["--organization-id=#{organization_id}"]
|
12
|
+
api_expects(:simple_content_access, :eligible).
|
13
|
+
with_params('organization_id' => organization_id).
|
14
|
+
returns("simple_content_access_eligible" => true)
|
15
|
+
|
16
|
+
api_expects(:simple_content_access, :enable)
|
17
|
+
.with_params('organization_id' => organization_id)
|
18
|
+
run_cmd(@cmd + params)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'fails on missing required params' do
|
22
|
+
params = []
|
23
|
+
result = run_cmd(@cmd + params)
|
24
|
+
expected_error = "Could not enable Simple Content Access for this organization"
|
25
|
+
|
26
|
+
assert_equal(result.exit_code, HammerCLI::EX_SOFTWARE)
|
27
|
+
assert_equal(result.err[/#{expected_error}/], expected_error)
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'fails on non eligible org' do
|
31
|
+
params = ["--organization-id=#{organization_id}"]
|
32
|
+
|
33
|
+
api_expects(:simple_content_access, :eligible).
|
34
|
+
with_params('organization_id' => organization_id).
|
35
|
+
returns("simple_content_access_eligible" => false)
|
36
|
+
|
37
|
+
api_expects(:simple_content_access, :enable)
|
38
|
+
.with_params('organization_id' => organization_id).never
|
39
|
+
result = run_cmd(@cmd + params)
|
40
|
+
|
41
|
+
expected_error = "Could not enable Simple Content Access for this organization"
|
42
|
+
|
43
|
+
assert_equal(result.exit_code, HammerCLI::EX_SOFTWARE)
|
44
|
+
assert_equal(result.err[/#{expected_error}/], expected_error)
|
45
|
+
end
|
46
|
+
end
|
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'] || '
|
20
|
+
KATELLO_VERSION = Gem::Version.new(ENV['TEST_API_VERSION'] || '4.0')
|
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: 0
|
4
|
+
version: '1.0'
|
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-
|
38
|
+
date: 2021-02-04 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: hammer_cli_foreman
|
@@ -249,7 +249,6 @@ files:
|
|
249
249
|
- lib/hammer_cli_katello/content_view.rb
|
250
250
|
- lib/hammer_cli_katello/content_view_component.rb
|
251
251
|
- lib/hammer_cli_katello/content_view_name_resolvable.rb
|
252
|
-
- lib/hammer_cli_katello/content_view_puppet_module.rb
|
253
252
|
- lib/hammer_cli_katello/content_view_purge.rb
|
254
253
|
- lib/hammer_cli_katello/content_view_version.rb
|
255
254
|
- lib/hammer_cli_katello/cv_import_export_helper.rb
|
@@ -261,7 +260,6 @@ files:
|
|
261
260
|
- lib/hammer_cli_katello/filter.rb
|
262
261
|
- lib/hammer_cli_katello/filter_rule.rb
|
263
262
|
- lib/hammer_cli_katello/foreman_search_options_creators.rb
|
264
|
-
- lib/hammer_cli_katello/gpg_key.rb
|
265
263
|
- lib/hammer_cli_katello/host.rb
|
266
264
|
- lib/hammer_cli_katello/host_collection.rb
|
267
265
|
- lib/hammer_cli_katello/host_collection_erratum.rb
|
@@ -298,11 +296,11 @@ files:
|
|
298
296
|
- lib/hammer_cli_katello/ping.rb
|
299
297
|
- lib/hammer_cli_katello/product.rb
|
300
298
|
- lib/hammer_cli_katello/product_content.rb
|
301
|
-
- lib/hammer_cli_katello/puppet_module.rb
|
302
299
|
- lib/hammer_cli_katello/repository.rb
|
303
300
|
- lib/hammer_cli_katello/repository_scoped_to_product.rb
|
304
301
|
- lib/hammer_cli_katello/repository_set.rb
|
305
302
|
- lib/hammer_cli_katello/search_options_creators.rb
|
303
|
+
- lib/hammer_cli_katello/simple_content_access.rb
|
306
304
|
- lib/hammer_cli_katello/srpm.rb
|
307
305
|
- lib/hammer_cli_katello/status.rb
|
308
306
|
- lib/hammer_cli_katello/subscription.rb
|
@@ -335,6 +333,7 @@ files:
|
|
335
333
|
- test/data/3.16/foreman_api.json
|
336
334
|
- test/data/3.17/foreman_api.json
|
337
335
|
- test/data/3.18/foreman_api.json
|
336
|
+
- test/data/3.19/foreman_api.json
|
338
337
|
- test/data/3.2/foreman_api.json
|
339
338
|
- test/data/3.4/foreman_api.json
|
340
339
|
- test/data/3.5/foreman_api.json
|
@@ -342,6 +341,7 @@ files:
|
|
342
341
|
- test/data/3.7/foreman_api.json
|
343
342
|
- test/data/3.8/foreman_api.json
|
344
343
|
- test/data/3.9/foreman_api.json
|
344
|
+
- test/data/4.0/foreman_api.json
|
345
345
|
- test/data/Readme.md
|
346
346
|
- test/functional/activation_key/add_host_collection_test.rb
|
347
347
|
- test/functional/activation_key/content_override_test.rb
|
@@ -367,6 +367,8 @@ files:
|
|
367
367
|
- test/functional/capsule/content/synchronization_status_test.rb
|
368
368
|
- test/functional/capsule/info_test.rb
|
369
369
|
- test/functional/capsule/list_test.rb
|
370
|
+
- test/functional/content_credentials/create_test.rb
|
371
|
+
- test/functional/content_credentials/data/test_cert.json
|
370
372
|
- test/functional/content_credentials/info_test.rb
|
371
373
|
- test/functional/content_credentials/list_test.rb
|
372
374
|
- test/functional/content_export/complete/library_test.rb
|
@@ -396,8 +398,6 @@ files:
|
|
396
398
|
- test/functional/content_view/filter/update_test.rb
|
397
399
|
- test/functional/content_view/list_test.rb
|
398
400
|
- test/functional/content_view/publish_test.rb
|
399
|
-
- test/functional/content_view/puppet_module/add_test.rb
|
400
|
-
- test/functional/content_view/puppet_module/remove_test.rb
|
401
401
|
- test/functional/content_view/purge_test.rb
|
402
402
|
- test/functional/content_view/remove_content_view_version_test.rb
|
403
403
|
- test/functional/content_view/remove_test.rb
|
@@ -422,7 +422,6 @@ files:
|
|
422
422
|
- test/functional/filter_rule/info_test.rb
|
423
423
|
- test/functional/filter_rule/list_test.rb
|
424
424
|
- test/functional/filter_rule/update_test.rb
|
425
|
-
- test/functional/gpg_test.rb
|
426
425
|
- test/functional/host/errata/apply_test.rb
|
427
426
|
- test/functional/host/errata/info_test.rb
|
428
427
|
- test/functional/host/errata/list_test.rb
|
@@ -482,9 +481,6 @@ files:
|
|
482
481
|
- test/functional/product/update_proxy.rb
|
483
482
|
- test/functional/product/update_test.rb
|
484
483
|
- test/functional/repository/create_test.rb
|
485
|
-
- test/functional/repository/data/test_ca.json
|
486
|
-
- test/functional/repository/data/test_cert.json
|
487
|
-
- test/functional/repository/data/test_key.json
|
488
484
|
- test/functional/repository/delete_test.rb
|
489
485
|
- test/functional/repository/export_test.rb
|
490
486
|
- test/functional/repository/info_test.rb
|
@@ -501,6 +497,8 @@ files:
|
|
501
497
|
- test/functional/repository_set/list_test.rb
|
502
498
|
- test/functional/repository_set/repository_set_helpers.rb
|
503
499
|
- test/functional/search_helpers.rb
|
500
|
+
- test/functional/simple_content_access/disable_test.rb
|
501
|
+
- test/functional/simple_content_access/enable_test.rb
|
504
502
|
- test/functional/srpm/list_test.rb
|
505
503
|
- test/functional/subscription/list_test.rb
|
506
504
|
- test/functional/sync_plan/create_test.rb
|
@@ -551,6 +549,7 @@ test_files:
|
|
551
549
|
- test/data/3.16/foreman_api.json
|
552
550
|
- test/data/3.17/foreman_api.json
|
553
551
|
- test/data/3.18/foreman_api.json
|
552
|
+
- test/data/3.19/foreman_api.json
|
554
553
|
- test/data/3.2/foreman_api.json
|
555
554
|
- test/data/3.4/foreman_api.json
|
556
555
|
- test/data/3.5/foreman_api.json
|
@@ -558,6 +557,7 @@ test_files:
|
|
558
557
|
- test/data/3.7/foreman_api.json
|
559
558
|
- test/data/3.8/foreman_api.json
|
560
559
|
- test/data/3.9/foreman_api.json
|
560
|
+
- test/data/4.0/foreman_api.json
|
561
561
|
- test/data/Readme.md
|
562
562
|
- test/functional/activation_key/add_host_collection_test.rb
|
563
563
|
- test/functional/activation_key/content_override_test.rb
|
@@ -583,6 +583,8 @@ test_files:
|
|
583
583
|
- test/functional/capsule/content/synchronization_status_test.rb
|
584
584
|
- test/functional/capsule/info_test.rb
|
585
585
|
- test/functional/capsule/list_test.rb
|
586
|
+
- test/functional/content_credentials/create_test.rb
|
587
|
+
- test/functional/content_credentials/data/test_cert.json
|
586
588
|
- test/functional/content_credentials/info_test.rb
|
587
589
|
- test/functional/content_credentials/list_test.rb
|
588
590
|
- test/functional/content_export/complete/library_test.rb
|
@@ -612,8 +614,6 @@ test_files:
|
|
612
614
|
- test/functional/content_view/filter/update_test.rb
|
613
615
|
- test/functional/content_view/list_test.rb
|
614
616
|
- test/functional/content_view/publish_test.rb
|
615
|
-
- test/functional/content_view/puppet_module/add_test.rb
|
616
|
-
- test/functional/content_view/puppet_module/remove_test.rb
|
617
617
|
- test/functional/content_view/purge_test.rb
|
618
618
|
- test/functional/content_view/remove_content_view_version_test.rb
|
619
619
|
- test/functional/content_view/remove_test.rb
|
@@ -638,7 +638,6 @@ test_files:
|
|
638
638
|
- test/functional/filter_rule/info_test.rb
|
639
639
|
- test/functional/filter_rule/list_test.rb
|
640
640
|
- test/functional/filter_rule/update_test.rb
|
641
|
-
- test/functional/gpg_test.rb
|
642
641
|
- test/functional/host/errata/apply_test.rb
|
643
642
|
- test/functional/host/errata/info_test.rb
|
644
643
|
- test/functional/host/errata/list_test.rb
|
@@ -698,9 +697,6 @@ test_files:
|
|
698
697
|
- test/functional/product/update_proxy.rb
|
699
698
|
- test/functional/product/update_test.rb
|
700
699
|
- test/functional/repository/create_test.rb
|
701
|
-
- test/functional/repository/data/test_ca.json
|
702
|
-
- test/functional/repository/data/test_cert.json
|
703
|
-
- test/functional/repository/data/test_key.json
|
704
700
|
- test/functional/repository/delete_test.rb
|
705
701
|
- test/functional/repository/export_test.rb
|
706
702
|
- test/functional/repository/info_test.rb
|
@@ -717,6 +713,8 @@ test_files:
|
|
717
713
|
- test/functional/repository_set/list_test.rb
|
718
714
|
- test/functional/repository_set/repository_set_helpers.rb
|
719
715
|
- test/functional/search_helpers.rb
|
716
|
+
- test/functional/simple_content_access/disable_test.rb
|
717
|
+
- test/functional/simple_content_access/enable_test.rb
|
720
718
|
- test/functional/srpm/list_test.rb
|
721
719
|
- test/functional/subscription/list_test.rb
|
722
720
|
- test/functional/sync_plan/create_test.rb
|
@@ -1,60 +0,0 @@
|
|
1
|
-
module HammerCLIKatello
|
2
|
-
class ContentViewPuppetModule < HammerCLIKatello::Command
|
3
|
-
resource :content_view_puppet_modules
|
4
|
-
command_name 'puppet-module'
|
5
|
-
desc 'View and manage puppet modules'
|
6
|
-
|
7
|
-
class ListCommand < HammerCLIKatello::ListCommand
|
8
|
-
include OrganizationOptions
|
9
|
-
|
10
|
-
output do
|
11
|
-
field :uuid, _("UUID")
|
12
|
-
field :name, _("Name")
|
13
|
-
field :author, _("Author")
|
14
|
-
field :version, _("Version")
|
15
|
-
end
|
16
|
-
|
17
|
-
def extend_data(mod)
|
18
|
-
mod['version'] = if mod['uuid']
|
19
|
-
mod['computed_version']
|
20
|
-
else
|
21
|
-
_("Latest(Currently %s)") % mod['computed_version']
|
22
|
-
end
|
23
|
-
mod
|
24
|
-
end
|
25
|
-
|
26
|
-
build_options
|
27
|
-
end
|
28
|
-
|
29
|
-
class CreateCommand < HammerCLIKatello::CreateCommand
|
30
|
-
include OrganizationOptions
|
31
|
-
|
32
|
-
command_name "add"
|
33
|
-
|
34
|
-
success_message _("Puppet module added to content view.")
|
35
|
-
failure_message _("Could not add the puppet module")
|
36
|
-
|
37
|
-
build_options
|
38
|
-
|
39
|
-
def get_identifier(*)
|
40
|
-
# This will intentionally disable the id resolver. Without it, if the user were to
|
41
|
-
# execute the 'add' command specifying a 'name', the id resolver will attempt to
|
42
|
-
# translate the 'name' to an 'id'. That is not desirable for this command.
|
43
|
-
nil
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
class DeleteCommand < HammerCLIKatello::DeleteCommand
|
48
|
-
include OrganizationOptions
|
49
|
-
|
50
|
-
command_name "remove"
|
51
|
-
|
52
|
-
success_message _("Puppet module removed from content view.")
|
53
|
-
failure_message _("Couldn't remove puppet module from the content view")
|
54
|
-
|
55
|
-
build_options
|
56
|
-
end
|
57
|
-
|
58
|
-
autoload_subcommands
|
59
|
-
end
|
60
|
-
end
|
@@ -1,67 +0,0 @@
|
|
1
|
-
module HammerCLIKatello
|
2
|
-
class GpgKeyCommand < HammerCLIForeman::Command
|
3
|
-
resource :gpg_keys
|
4
|
-
|
5
|
-
class ListCommand < HammerCLIKatello::ListCommand
|
6
|
-
output do
|
7
|
-
field :id, _("ID")
|
8
|
-
field :name, _("Name")
|
9
|
-
end
|
10
|
-
|
11
|
-
build_options
|
12
|
-
end
|
13
|
-
|
14
|
-
class InfoCommand < HammerCLIKatello::InfoCommand
|
15
|
-
output do
|
16
|
-
field :id, _("ID")
|
17
|
-
field :name, _("Name")
|
18
|
-
from :organization do
|
19
|
-
field :name, _("Organization")
|
20
|
-
end
|
21
|
-
|
22
|
-
collection :repositories, "Repositories" do
|
23
|
-
field :id, _("ID")
|
24
|
-
field :name, _("Name")
|
25
|
-
field :content_type, _("Content Type")
|
26
|
-
from :product do
|
27
|
-
field :name, _("Product")
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
field :content, _("Content"), Fields::LongText
|
32
|
-
end
|
33
|
-
|
34
|
-
build_options
|
35
|
-
end
|
36
|
-
|
37
|
-
class CreateCommand < HammerCLIKatello::CreateCommand
|
38
|
-
success_message _("GPG Key created.")
|
39
|
-
failure_message _("Could not create GPG Key")
|
40
|
-
|
41
|
-
build_options :without => [:content]
|
42
|
-
option "--key", "GPG_KEY_FILE", _("GPG Key file"),
|
43
|
-
:attribute_name => :option_content,
|
44
|
-
:required => true,
|
45
|
-
:format => HammerCLI::Options::Normalizers::File.new
|
46
|
-
end
|
47
|
-
|
48
|
-
class UpdateCommand < HammerCLIKatello::UpdateCommand
|
49
|
-
success_message _("GPG Key updated.")
|
50
|
-
failure_message _("Could not update GPG Key")
|
51
|
-
|
52
|
-
build_options :without => [:content]
|
53
|
-
option "--key", "GPG_KEY_FILE", _("GPG Key file"),
|
54
|
-
:attribute_name => :option_content,
|
55
|
-
:format => HammerCLI::Options::Normalizers::File.new
|
56
|
-
end
|
57
|
-
|
58
|
-
class DeleteCommand < HammerCLIKatello::DeleteCommand
|
59
|
-
success_message _("GPG Key deleted.")
|
60
|
-
failure_message _("Could not delete the GPG Key")
|
61
|
-
|
62
|
-
build_options
|
63
|
-
end
|
64
|
-
|
65
|
-
autoload_subcommands
|
66
|
-
end
|
67
|
-
end
|