hammer_cli_katello 1.1.1 → 1.3.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/command_extensions/content_source.rb +32 -0
- data/lib/hammer_cli_katello/command_extensions/kickstart_repository.rb +50 -0
- data/lib/hammer_cli_katello/command_extensions/lifecycle_environment.rb +12 -0
- data/lib/hammer_cli_katello/command_extensions.rb +2 -0
- data/lib/hammer_cli_katello/commands.rb +1 -1
- data/lib/hammer_cli_katello/content_export_helper.rb +6 -2
- data/lib/hammer_cli_katello/content_view.rb +11 -0
- data/lib/hammer_cli_katello/content_view_version.rb +3 -3
- data/lib/hammer_cli_katello/host_collection.rb +6 -0
- data/lib/hammer_cli_katello/host_collection_erratum.rb +10 -0
- data/lib/hammer_cli_katello/host_collection_package.rb +30 -0
- data/lib/hammer_cli_katello/host_collection_package_group.rb +30 -0
- data/lib/hammer_cli_katello/host_errata.rb +10 -3
- data/lib/hammer_cli_katello/host_extensions.rb +8 -6
- data/lib/hammer_cli_katello/host_package.rb +32 -0
- data/lib/hammer_cli_katello/host_package_group.rb +16 -0
- data/lib/hammer_cli_katello/hostgroup_extensions.rb +19 -12
- data/lib/hammer_cli_katello/id_resolver.rb +5 -2
- data/lib/hammer_cli_katello/option_sources/lifecycle_environment_params.rb +40 -3
- data/lib/hammer_cli_katello/organization.rb +28 -3
- data/lib/hammer_cli_katello/package.rb +2 -1
- data/lib/hammer_cli_katello/ping.rb +7 -0
- data/lib/hammer_cli_katello/repository.rb +10 -31
- data/lib/hammer_cli_katello/search_options_creators.rb +2 -1
- data/lib/hammer_cli_katello/srpm.rb +2 -0
- data/lib/hammer_cli_katello/version.rb +1 -1
- data/test/data/4.3/foreman_api.json +1 -0
- data/test/functional/activation_key/create_test.rb +1 -1
- data/test/functional/activation_key/subscriptions_test.rb +1 -1
- data/test/functional/content_view/version/promote_test.rb +41 -0
- data/test/functional/content_view/version/republish_repositories_test.rb +1 -1
- data/test/functional/host/errata/recalculate_test.rb +8 -22
- data/test/functional/host_collection/create_test.rb +11 -0
- data/test/functional/module_stream/info_test.rb +1 -1
- data/test/functional/organization/cdn_configuration_test.rb +42 -0
- data/test/functional/organization/info_test.rb +17 -0
- data/test/functional/package/list_test.rb +4 -2
- data/test/functional/ping_test.rb +3 -1
- data/test/functional/srpm/list_test.rb +1 -1
- data/test/functional/subscription/list_test.rb +2 -2
- data/test/test_helper.rb +1 -1
- metadata +9 -7
- data/lib/hammer_cli_katello/host_content_source_options.rb +0 -28
- data/lib/hammer_cli_katello/host_kickstart_repository_options.rb +0 -49
- data/test/functional/repository/export_test.rb +0 -121
@@ -20,9 +20,17 @@ module HammerCLIKatello
|
|
20
20
|
output do
|
21
21
|
field :label, _("Label")
|
22
22
|
field :description, _("Description")
|
23
|
-
field :redhat_repository_url, _("Red Hat Repository URL")
|
24
23
|
field :simple_content_access_label, _("Simple Content Access")
|
25
24
|
field :service_levels, _("Service Levels"), Fields::List
|
25
|
+
from :cdn_configuration do
|
26
|
+
label "CDN configuration", hide_blank: true do
|
27
|
+
field :url, _("URL"), Fields::Field, hide_blank: true
|
28
|
+
field :upstream_organization_label, _("Upstream Organization"),
|
29
|
+
Fields::Field, hide_blank: true
|
30
|
+
field :username, _("Username"), Fields::Field, hide_blank: true
|
31
|
+
field :ssl_ca_credential_id, _("SSL CA Credential ID"), Fields::Field, hide_blank: true
|
32
|
+
end
|
33
|
+
end
|
26
34
|
end
|
27
35
|
|
28
36
|
def extend_data(data)
|
@@ -44,7 +52,9 @@ module HammerCLIKatello
|
|
44
52
|
success_message _("Organization updated.")
|
45
53
|
failure_message _("Could not update the organization")
|
46
54
|
|
47
|
-
build_options
|
55
|
+
build_options do |o|
|
56
|
+
o.expand(:all).except(:environments)
|
57
|
+
end
|
48
58
|
end
|
49
59
|
|
50
60
|
class CreateCommand < HammerCLIForeman::Organization::CreateCommand
|
@@ -54,7 +64,9 @@ module HammerCLIKatello
|
|
54
64
|
success_message _("Organization created.")
|
55
65
|
failure_message _("Could not create the organization")
|
56
66
|
|
57
|
-
build_options
|
67
|
+
build_options do |o|
|
68
|
+
o.expand(:all).except(:environments)
|
69
|
+
end
|
58
70
|
end
|
59
71
|
|
60
72
|
class DeleteCommand < HammerCLIForeman::Organization::DeleteCommand
|
@@ -68,6 +80,19 @@ module HammerCLIKatello
|
|
68
80
|
build_options
|
69
81
|
end
|
70
82
|
|
83
|
+
class ConfigureCdnCommand < HammerCLIKatello::SingleResourceCommand
|
84
|
+
include HammerCLIKatello::ResolverCommons
|
85
|
+
resource :organizations, :cdn_configuration
|
86
|
+
command_name "configure-cdn"
|
87
|
+
success_message _("Updated CDN configuration.")
|
88
|
+
failure_message _("Could not update CDN configuration.")
|
89
|
+
|
90
|
+
build_options do |o|
|
91
|
+
o.expand(:all).except(:organizations, :locations)
|
92
|
+
o.without(:organization_id, :location_id)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
71
96
|
autoload_subcommands
|
72
97
|
end
|
73
98
|
end
|
@@ -3,7 +3,6 @@ module HammerCLIKatello
|
|
3
3
|
resource :packages
|
4
4
|
|
5
5
|
class ListCommand < HammerCLIKatello::ListCommand
|
6
|
-
extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
|
7
6
|
include LifecycleEnvironmentNameMapping
|
8
7
|
|
9
8
|
output do
|
@@ -40,6 +39,8 @@ module HammerCLIKatello
|
|
40
39
|
build_options do |o|
|
41
40
|
o.expand.including(:products, :content_views)
|
42
41
|
end
|
42
|
+
|
43
|
+
extend_with(HammerCLIKatello::CommandExtensions::LifecycleEnvironment.new)
|
43
44
|
end
|
44
45
|
|
45
46
|
class InfoCommand < HammerCLIKatello::InfoCommand
|
@@ -51,6 +51,13 @@ module HammerCLIKatello
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
label "pulp3_content", :hide_blank => true do
|
55
|
+
from "pulp3_content" do
|
56
|
+
field "status", _("Status"), Fields::Field, :hide_blank => true
|
57
|
+
field "_response", _("Server Response"), Fields::Field, :hide_blank => true
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
54
61
|
label "foreman_tasks" do
|
55
62
|
from "foreman_tasks" do
|
56
63
|
field "status", _("Status")
|
@@ -62,10 +62,6 @@ module HammerCLIKatello
|
|
62
62
|
field :full_path, _("Published At")
|
63
63
|
field :relative_path, _("Relative Path")
|
64
64
|
field :download_policy, _("Download Policy"), Fields::Field, :hide_blank => true
|
65
|
-
field :ostree_upstream_sync_policy, _("OSTree Upstream Sync Policy"),
|
66
|
-
Fields::Field, :hide_blank => true
|
67
|
-
field :_ostree_upstream_sync_depth, _("OSTree Upstream Sync Depth"),
|
68
|
-
Fields::Field, :hide_blank => true
|
69
65
|
field :docker_upstream_name, _("Upstream Repository Name"),
|
70
66
|
Fields::Field, :hide_blank => true
|
71
67
|
field :docker_tags_whitelist, _("Container Image Tags Filter"),
|
@@ -403,6 +399,12 @@ module HammerCLIKatello
|
|
403
399
|
build_options(:without => [:content]) do |o|
|
404
400
|
o.expand.including(:products, :organizations)
|
405
401
|
end
|
402
|
+
|
403
|
+
option "--ostree-repository-name", "OSTREE REPOSITORY NAME",
|
404
|
+
_("Name of OSTree repository in archive."),
|
405
|
+
:attribute_name => :option_ostree_repository_name,
|
406
|
+
:required => false
|
407
|
+
|
406
408
|
option "--path", "PATH", _("Upload file, directory of files, or glob of files " \
|
407
409
|
"as content for a repository.\n" \
|
408
410
|
"Globs must be escaped by single or double quotes"),
|
@@ -423,6 +425,7 @@ module HammerCLIKatello
|
|
423
425
|
repo_id = get_identifier
|
424
426
|
update_content_upload(upload_id, repo_id, file)
|
425
427
|
end
|
428
|
+
opts[:ostree_repository_name] = options["option_ostree_repository_name"]
|
426
429
|
results = import_uploads([
|
427
430
|
{
|
428
431
|
id: upload_id,
|
@@ -479,6 +482,9 @@ module HammerCLIKatello
|
|
479
482
|
sync_capsule: sync_capsule
|
480
483
|
}
|
481
484
|
params[:content_type] = options["option_content_type"] if options["option_content_type"]
|
485
|
+
if options["option_ostree_repository_name"]
|
486
|
+
params[:ostree_repository_name] = options["option_ostree_repository_name"]
|
487
|
+
end
|
482
488
|
resource.call(:import_uploads, params)
|
483
489
|
end
|
484
490
|
|
@@ -541,33 +547,6 @@ module HammerCLIKatello
|
|
541
547
|
end
|
542
548
|
end
|
543
549
|
|
544
|
-
class ExportCommand < HammerCLIKatello::SingleResourceCommand
|
545
|
-
include HammerCLIForemanTasks::Async
|
546
|
-
include OrganizationOptions
|
547
|
-
extend RepositoryScopedToProduct
|
548
|
-
|
549
|
-
validate_repo_name_requires_product_options
|
550
|
-
action :export
|
551
|
-
command_name "export"
|
552
|
-
desc _("Export content from a repository to the configured directory")
|
553
|
-
|
554
|
-
success_message _("Repository is being exported in task %{id}.")
|
555
|
-
failure_message _("Could not export the repository")
|
556
|
-
|
557
|
-
validate_options :before, 'IdResolution' do
|
558
|
-
organization_options = [:option_organization_id, :option_organization_name, \
|
559
|
-
:option_organization_label]
|
560
|
-
|
561
|
-
if option(:option_product_name).exist?
|
562
|
-
any(*organization_options).required
|
563
|
-
end
|
564
|
-
end
|
565
|
-
|
566
|
-
build_options do |o|
|
567
|
-
o.expand.including(:products)
|
568
|
-
end
|
569
|
-
end
|
570
|
-
|
571
550
|
autoload_subcommands
|
572
551
|
end
|
573
552
|
end
|
@@ -57,7 +57,8 @@ module HammerCLIKatello
|
|
57
57
|
def create_lifecycle_environments_search_options(options, mode = nil)
|
58
58
|
search_options = {}
|
59
59
|
if mode != :multi
|
60
|
-
name = options[HammerCLI.option_accessor_name("
|
60
|
+
name = options[HammerCLI.option_accessor_name("environment_name")] ||
|
61
|
+
options[HammerCLI.option_accessor_name("name")]
|
61
62
|
search_options['name'] = name if name
|
62
63
|
end
|
63
64
|
organization_id = organization_id(scoped_options('organization', options, :single))
|