hammer_cli_katello 1.4.1 → 1.5.0
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.
- checksums.yaml +4 -4
- data/lib/hammer_cli_katello/content_export_complete.rb +8 -0
- data/lib/hammer_cli_katello/content_export_helper.rb +55 -3
- data/lib/hammer_cli_katello/content_export_incremental.rb +8 -0
- data/lib/hammer_cli_katello/content_import.rb +9 -0
- data/lib/hammer_cli_katello/host_collection.rb +2 -0
- data/lib/hammer_cli_katello/id_resolver.rb +3 -2
- data/lib/hammer_cli_katello/organization.rb +11 -0
- data/lib/hammer_cli_katello/repository.rb +39 -2
- data/lib/hammer_cli_katello/version.rb +1 -1
- metadata +4 -398
- data/test/data/2.5/foreman_api.json +0 -1
- data/test/data/3.0/foreman_api.json +0 -1
- data/test/data/3.10/foreman_api.json +0 -1
- data/test/data/3.11/foreman_api.json +0 -1
- data/test/data/3.12/foreman_api.json +0 -1
- data/test/data/3.13/foreman_api.json +0 -1
- data/test/data/3.14/foreman_api.json +0 -1
- data/test/data/3.15/foreman_api.json +0 -1
- data/test/data/3.16/foreman_api.json +0 -1
- data/test/data/3.17/foreman_api.json +0 -1
- data/test/data/3.18/foreman_api.json +0 -1
- data/test/data/3.19/foreman_api.json +0 -1
- data/test/data/3.2/foreman_api.json +0 -1
- data/test/data/3.4/foreman_api.json +0 -1
- data/test/data/3.5/foreman_api.json +0 -1
- data/test/data/3.6/foreman_api.json +0 -1
- data/test/data/3.7/foreman_api.json +0 -1
- data/test/data/3.8/foreman_api.json +0 -1
- data/test/data/3.9/foreman_api.json +0 -1
- data/test/data/4.0/foreman_api.json +0 -1
- data/test/data/4.1/foreman_api.json +0 -1
- data/test/data/4.3/foreman_api.json +0 -1
- data/test/data/4.4/foreman_api.json +0 -1
- data/test/data/Readme.md +0 -5
- data/test/functional/activation_key/add_host_collection_test.rb +0 -62
- data/test/functional/activation_key/content_override_test.rb +0 -92
- data/test/functional/activation_key/create_test.rb +0 -33
- data/test/functional/activation_key/data/activation_key.json +0 -17
- data/test/functional/activation_key/info_test.rb +0 -29
- data/test/functional/activation_key/list_test.rb +0 -68
- data/test/functional/activation_key/product_content_test.rb +0 -23
- data/test/functional/activation_key/remove_host_collection_test.rb +0 -62
- data/test/functional/activation_key/subscriptions_test.rb +0 -74
- data/test/functional/activation_key/update_test.rb +0 -26
- data/test/functional/apipie_helper_test.rb +0 -31
- data/test/functional/capsule/capsule_helpers.rb +0 -13
- data/test/functional/capsule/content/add_lifecycle_environment_test.rb +0 -40
- data/test/functional/capsule/content/cancel_synchronization_test.rb +0 -42
- data/test/functional/capsule/content/capsule_content_helpers.rb +0 -24
- data/test/functional/capsule/content/data/library_env.json +0 -47
- data/test/functional/capsule/content/data/sync_status.json +0 -6
- data/test/functional/capsule/content/data/sync_tasks.json +0 -62
- data/test/functional/capsule/content/info_test.rb +0 -61
- data/test/functional/capsule/content/lifecycle_environments_test.rb +0 -19
- data/test/functional/capsule/content/remove_lifecycle_environment_test.rb +0 -40
- data/test/functional/capsule/content/synchronization_status_test.rb +0 -107
- data/test/functional/capsule/info_test.rb +0 -25
- data/test/functional/capsule/list_test.rb +0 -24
- data/test/functional/content_credentials/create_test.rb +0 -32
- data/test/functional/content_credentials/data/test_cert.json +0 -43
- data/test/functional/content_credentials/info_test.rb +0 -50
- data/test/functional/content_credentials/list_test.rb +0 -66
- data/test/functional/content_export/complete/library_test.rb +0 -155
- data/test/functional/content_export/complete/version_test.rb +0 -252
- data/test/functional/content_export/content_export_helpers.rb +0 -26
- data/test/functional/content_export/generate_metadata_test.rb +0 -64
- data/test/functional/content_export/incremental/library_test.rb +0 -172
- data/test/functional/content_export/incremental/version_test.rb +0 -268
- data/test/functional/content_export/list_test.rb +0 -64
- data/test/functional/content_import/library_test.rb +0 -85
- data/test/functional/content_import/list_test.rb +0 -65
- data/test/functional/content_import/metadata.json +0 -1
- data/test/functional/content_import/version_test.rb +0 -85
- data/test/functional/content_units/info_test.rb +0 -29
- data/test/functional/content_units/list_test.rb +0 -106
- data/test/functional/content_view/add_content_view_version_test.rb +0 -88
- data/test/functional/content_view/add_repository_test.rb +0 -21
- data/test/functional/content_view/component/add_test.rb +0 -177
- data/test/functional/content_view/component/list_test.rb +0 -55
- data/test/functional/content_view/component/remove_test.rb +0 -107
- data/test/functional/content_view/component/update_test.rb +0 -134
- data/test/functional/content_view/content_view_helpers.rb +0 -20
- data/test/functional/content_view/copy_test.rb +0 -53
- data/test/functional/content_view/create_test.rb +0 -34
- data/test/functional/content_view/delete_test.rb +0 -62
- data/test/functional/content_view/filter/create_test.rb +0 -57
- data/test/functional/content_view/filter/delete_test.rb +0 -90
- data/test/functional/content_view/filter/info_test.rb +0 -89
- data/test/functional/content_view/filter/list_test.rb +0 -98
- data/test/functional/content_view/filter/update_test.rb +0 -91
- data/test/functional/content_view/list_test.rb +0 -68
- data/test/functional/content_view/publish_test.rb +0 -24
- data/test/functional/content_view/purge_test.rb +0 -97
- data/test/functional/content_view/remove_content_view_version_test.rb +0 -88
- data/test/functional/content_view/remove_test.rb +0 -79
- data/test/functional/content_view/update_test.rb +0 -53
- data/test/functional/content_view/version/incremental_update_test.rb +0 -108
- data/test/functional/content_view/version/list_test.rb +0 -44
- data/test/functional/content_view/version/promote_test.rb +0 -75
- data/test/functional/content_view/version/republish_repositories_test.rb +0 -34
- data/test/functional/content_view/version/update_test.rb +0 -48
- data/test/functional/erratum/erratum_helpers.rb +0 -91
- data/test/functional/erratum/info_test.rb +0 -29
- data/test/functional/erratum/list_test.rb +0 -108
- data/test/functional/file/file_helpers.rb +0 -13
- data/test/functional/file/info_test.rb +0 -162
- data/test/functional/file/list_test.rb +0 -112
- data/test/functional/filter_rule/create_test.rb +0 -99
- data/test/functional/filter_rule/delete_test.rb +0 -104
- data/test/functional/filter_rule/filter_rule_helpers.rb +0 -12
- data/test/functional/filter_rule/info_test.rb +0 -104
- data/test/functional/filter_rule/list_test.rb +0 -91
- data/test/functional/filter_rule/update_test.rb +0 -104
- data/test/functional/host/errata/apply_test.rb +0 -45
- data/test/functional/host/errata/info_test.rb +0 -27
- data/test/functional/host/errata/list_test.rb +0 -49
- data/test/functional/host/errata/recalculate_test.rb +0 -26
- data/test/functional/host/extensions/create_test.rb +0 -95
- data/test/functional/host/extensions/data/host.json +0 -320
- data/test/functional/host/extensions/data/host_list.json +0 -117
- data/test/functional/host/extensions/info_test.rb +0 -35
- data/test/functional/host/extensions/list_test.rb +0 -21
- data/test/functional/host/extensions/update_test.rb +0 -70
- data/test/functional/host/host_helpers.rb +0 -8
- data/test/functional/host/subscription/attach_test.rb +0 -54
- data/test/functional/host/subscription/auto_attach_test.rb +0 -35
- data/test/functional/host/subscription/content_override_test.rb +0 -96
- data/test/functional/host/subscription/product_content_test.rb +0 -27
- data/test/functional/host/subscription/register_test.rb +0 -53
- data/test/functional/host/subscription/remove_test.rb +0 -52
- data/test/functional/host/subscription/unregister_test.rb +0 -37
- data/test/functional/host/traces/list_test.rb +0 -37
- data/test/functional/host/traces/resolve_test.rb +0 -31
- data/test/functional/host_collection/add_host_test.rb +0 -90
- data/test/functional/host_collection/content_api_expectations.rb +0 -35
- data/test/functional/host_collection/content_install_test.rb +0 -62
- data/test/functional/host_collection/content_remove_test.rb +0 -37
- data/test/functional/host_collection/content_update_test.rb +0 -37
- data/test/functional/host_collection/copy_test.rb +0 -64
- data/test/functional/host_collection/create_test.rb +0 -54
- data/test/functional/host_collection/delete_test.rb +0 -57
- data/test/functional/host_collection/hosts_test.rb +0 -39
- data/test/functional/host_collection/info_test.rb +0 -57
- data/test/functional/host_collection/list_test.rb +0 -63
- data/test/functional/host_collection/remove_host_test.rb +0 -90
- data/test/functional/host_collection/update_test.rb +0 -57
- data/test/functional/hostgroup/create_test.rb +0 -112
- data/test/functional/hostgroup/data/hostgroup.json +0 -50
- data/test/functional/hostgroup/info_test.rb +0 -33
- data/test/functional/hostgroup/update_test.rb +0 -120
- data/test/functional/lifecycle_environment/create_test.rb +0 -14
- data/test/functional/lifecycle_environment/lifecycle_environment_helpers.rb +0 -18
- data/test/functional/lifecycle_environment/list_test.rb +0 -38
- data/test/functional/lifecycle_environment/update_test.rb +0 -14
- data/test/functional/local_helper_test.rb +0 -30
- data/test/functional/module_stream/info_test.rb +0 -58
- data/test/functional/module_stream/list_test.rb +0 -53
- data/test/functional/organization/cdn_configuration_test.rb +0 -45
- data/test/functional/organization/delete_test.rb +0 -26
- data/test/functional/organization/info_test.rb +0 -39
- data/test/functional/organization/organization_helpers.rb +0 -10
- data/test/functional/package/list_test.rb +0 -160
- data/test/functional/package_group/list_test.rb +0 -38
- data/test/functional/ping_test.rb +0 -61
- data/test/functional/product/create_test.rb +0 -54
- data/test/functional/product/delete_test.rb +0 -41
- data/test/functional/product/info_test.rb +0 -33
- data/test/functional/product/list_test.rb +0 -58
- data/test/functional/product/product_helpers.rb +0 -24
- data/test/functional/product/remove_sync_plan_test.rb +0 -35
- data/test/functional/product/set_sync_plan_test.rb +0 -49
- data/test/functional/product/update_proxy.rb +0 -48
- data/test/functional/product/update_test.rb +0 -46
- data/test/functional/repository/create_test.rb +0 -21
- data/test/functional/repository/delete_test.rb +0 -95
- data/test/functional/repository/info_test.rb +0 -162
- data/test/functional/repository/list_test.rb +0 -68
- data/test/functional/repository/reclaim_space_test.rb +0 -105
- data/test/functional/repository/remove_content_test.rb +0 -108
- data/test/functional/repository/repository_helpers.rb +0 -18
- data/test/functional/repository/synchronize_test.rb +0 -57
- data/test/functional/repository/update_test.rb +0 -149
- data/test/functional/repository/upload_test.rb +0 -368
- data/test/functional/repository_set/available_repositories_test.rb +0 -18
- data/test/functional/repository_set/disable_test.rb +0 -42
- data/test/functional/repository_set/enable_test.rb +0 -42
- data/test/functional/repository_set/info_test.rb +0 -17
- data/test/functional/repository_set/list_test.rb +0 -18
- data/test/functional/repository_set/repository_set_helpers.rb +0 -20
- data/test/functional/search_helpers.rb +0 -17
- data/test/functional/simple_content_access/disable_test.rb +0 -48
- data/test/functional/simple_content_access/enable_test.rb +0 -46
- data/test/functional/srpm/list_test.rb +0 -92
- data/test/functional/subscription/list_test.rb +0 -86
- data/test/functional/sync_plan/create_test.rb +0 -60
- data/test/functional/sync_plan/delete_test.rb +0 -46
- data/test/functional/sync_plan/info_test.rb +0 -37
- data/test/functional/sync_plan/list_test.rb +0 -31
- data/test/functional/sync_plan/sync_plan_helpers.rb +0 -8
- data/test/functional/sync_plan/update_test.rb +0 -44
- data/test/functional/test_helper.rb +0 -24
- data/test/task_helper.rb +0 -7
- data/test/test_helper.rb +0 -38
- data/test/unit/id_name_options_validator_test.rb +0 -96
- data/test/unit/id_resolver_test.rb +0 -58
- data/test/unit/messages_test.rb +0 -7
- data/test/unit/search_options_creators_test.rb +0 -145
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f9402037812c97c98165fb0993f82063bafe1494644ce0e23f2302926e39eab9
|
|
4
|
+
data.tar.gz: 30ee3c5a4cecaa4822d3a2ec94630f8f26d22b5d643868fa76bd6d07286c10a9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 38efbc45b82eec60cfd40df5ae30051484aa0e2f1e8eb6877128ed6cef14d8bb801da8cea3704e2a3689b329ca86a89776a0a196226115cf313bd952214bd968
|
|
7
|
+
data.tar.gz: 4935236c67fac3f628e434492efcdf70341100d24c491aeb68dfc3aba5ddd5dbee93306d7c23a632e2c389bc0b055f1df59d8efddd28a27d4d44d93e14ce7602
|
|
@@ -20,6 +20,14 @@ module HammerCLIKatello
|
|
|
20
20
|
include ContentExportHelper
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
class RepositoryCommand < HammerCLIKatello::SingleResourceCommand
|
|
24
|
+
desc _("Performs a full export of a repository")
|
|
25
|
+
command_name "repository"
|
|
26
|
+
|
|
27
|
+
include HammerCLIForemanTasks::Async
|
|
28
|
+
include ContentExportHelper
|
|
29
|
+
end
|
|
30
|
+
|
|
23
31
|
autoload_subcommands
|
|
24
32
|
end
|
|
25
33
|
end
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
require 'hammer_cli_katello/repository'
|
|
2
|
+
|
|
2
3
|
# rubocop:disable ModuleLength
|
|
3
4
|
module HammerCLIKatello
|
|
4
5
|
module ContentExportHelper
|
|
@@ -40,7 +41,8 @@ module HammerCLIKatello
|
|
|
40
41
|
end
|
|
41
42
|
|
|
42
43
|
def fetch_export_history(export_history_id)
|
|
43
|
-
|
|
44
|
+
return unless export_history_id
|
|
45
|
+
index(:content_exports, :id => export_history_id).first
|
|
44
46
|
end
|
|
45
47
|
|
|
46
48
|
def fetch_export_history_from_task(task)
|
|
@@ -48,7 +50,6 @@ module HammerCLIKatello
|
|
|
48
50
|
if %w(error warning).include?(task['result'])
|
|
49
51
|
raise _("Can not fetch export history from an unfinished task")
|
|
50
52
|
end
|
|
51
|
-
|
|
52
53
|
export_history_id = task.dig('output', 'export_history_id')
|
|
53
54
|
fetch_export_history(export_history_id)
|
|
54
55
|
end
|
|
@@ -72,7 +73,16 @@ module HammerCLIKatello
|
|
|
72
73
|
self.class.command_name.first.to_sym == :version
|
|
73
74
|
end
|
|
74
75
|
|
|
76
|
+
def repository_command?
|
|
77
|
+
self.class.command_name.first.to_sym == :repository
|
|
78
|
+
end
|
|
79
|
+
|
|
75
80
|
def fetch_repositories
|
|
81
|
+
if repository_command?
|
|
82
|
+
resp = show(:repositories, id: resolver.repository_id(options))
|
|
83
|
+
return resp["download_policy"] == "immediate" ? [] : [resp]
|
|
84
|
+
end
|
|
85
|
+
|
|
76
86
|
repo_options = {
|
|
77
87
|
library: true,
|
|
78
88
|
content_type: 'yum',
|
|
@@ -95,6 +105,10 @@ module HammerCLIKatello
|
|
|
95
105
|
" Update the download policy and sync affected repositories."\
|
|
96
106
|
" Once synced republish the content view"\
|
|
97
107
|
" and export the generated version.")
|
|
108
|
+
elsif repository_command?
|
|
109
|
+
output.print_message _("NOTE: Unable to fully export this repository because"\
|
|
110
|
+
" it does not have the 'immediate' download policy."\
|
|
111
|
+
" Update the download policy, sync the repository and export.")
|
|
98
112
|
else
|
|
99
113
|
output.print_message _("NOTE: Unable to fully export this organization's library because"\
|
|
100
114
|
" it contains repositories without the 'immediate' download policy."\
|
|
@@ -107,7 +121,7 @@ module HammerCLIKatello
|
|
|
107
121
|
"--download-policy='immediate'"
|
|
108
122
|
output.print_message ""
|
|
109
123
|
print_record(::HammerCLIKatello::Repository::ListCommand.output_definition, repos)
|
|
110
|
-
exit(HammerCLI::EX_SOFTWARE) if option_fail_on_missing_content?
|
|
124
|
+
exit(HammerCLI::EX_SOFTWARE) if repository_command? || option_fail_on_missing_content?
|
|
111
125
|
end
|
|
112
126
|
end
|
|
113
127
|
|
|
@@ -116,6 +130,44 @@ module HammerCLIKatello
|
|
|
116
130
|
setup_version(base)
|
|
117
131
|
elsif base.command_name.first.to_sym == :library
|
|
118
132
|
setup_library(base)
|
|
133
|
+
elsif base.command_name.first.to_sym == :repository
|
|
134
|
+
setup_repository(base)
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
def self.setup_repository(base)
|
|
139
|
+
base.action(:repository)
|
|
140
|
+
base.success_message _("Repository is being exported in task %{id}.")
|
|
141
|
+
base.failure_message _("Could not export the repository")
|
|
142
|
+
|
|
143
|
+
base.option "--name", "NAME", _("Filter repositories by name."),
|
|
144
|
+
:attribute_name => :option_name,
|
|
145
|
+
:required => false
|
|
146
|
+
|
|
147
|
+
base.build_options do |o|
|
|
148
|
+
o.expand(:all).including(:products, :organizations)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
base.validate_options do
|
|
152
|
+
any(:option_id, :option_name).required
|
|
153
|
+
unless option(:option_id).exist?
|
|
154
|
+
any(
|
|
155
|
+
:option_product_id,
|
|
156
|
+
:option_product_name
|
|
157
|
+
).required
|
|
158
|
+
unless option(:option_product_id).exist?
|
|
159
|
+
any(:option_organization_id, :option_organization_name, \
|
|
160
|
+
:option_organization_label).required
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
base.class_eval do
|
|
166
|
+
def request_params
|
|
167
|
+
super.tap do |opts|
|
|
168
|
+
opts["id"] = resolver.repository_id(options)
|
|
169
|
+
end
|
|
170
|
+
end
|
|
119
171
|
end
|
|
120
172
|
end
|
|
121
173
|
|
|
@@ -20,6 +20,14 @@ module HammerCLIKatello
|
|
|
20
20
|
include ContentExportHelper
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
+
class RepositoryCommand < HammerCLIKatello::SingleResourceCommand
|
|
24
|
+
desc _("Performs an incremental export of a repository")
|
|
25
|
+
command_name "repository"
|
|
26
|
+
|
|
27
|
+
include HammerCLIForemanTasks::Async
|
|
28
|
+
include ContentExportHelper
|
|
29
|
+
end
|
|
30
|
+
|
|
23
31
|
autoload_subcommands
|
|
24
32
|
end
|
|
25
33
|
end
|
|
@@ -58,6 +58,15 @@ module HammerCLIKatello
|
|
|
58
58
|
include ContentImportCommon
|
|
59
59
|
end
|
|
60
60
|
|
|
61
|
+
class RepositoryCommand < HammerCLIKatello::SingleResourceCommand
|
|
62
|
+
desc _("Imports a repository")
|
|
63
|
+
action :repository
|
|
64
|
+
command_name "repository"
|
|
65
|
+
|
|
66
|
+
include HammerCLIForemanTasks::Async
|
|
67
|
+
include ContentImportCommon
|
|
68
|
+
end
|
|
69
|
+
|
|
61
70
|
class ListCommand < HammerCLIKatello::ListCommand
|
|
62
71
|
desc "View content view import histories"
|
|
63
72
|
output do
|
|
@@ -143,6 +143,8 @@ module HammerCLIKatello
|
|
|
143
143
|
success_message _("Host collection updated.")
|
|
144
144
|
failure_message _("Could not update the the host collection")
|
|
145
145
|
|
|
146
|
+
option "--unlimited-hosts", :flag, "Set hosts max to unlimited"
|
|
147
|
+
|
|
146
148
|
build_options { |o| o.expand(:all).including(:organizations) }
|
|
147
149
|
end
|
|
148
150
|
|
|
@@ -29,8 +29,9 @@ module HammerCLIKatello
|
|
|
29
29
|
:sync_plan => [s_name(_("Sync plan name to search by"))],
|
|
30
30
|
:task => [s_name(_("Task name to search by"))],
|
|
31
31
|
:content_view_version => [s("version", _("Content view version number"))],
|
|
32
|
-
:content_export
|
|
33
|
-
:
|
|
32
|
+
:content_export => [],
|
|
33
|
+
:content_export_incremental => [],
|
|
34
|
+
:content_import => []
|
|
34
35
|
}.freeze
|
|
35
36
|
|
|
36
37
|
DEFAULT_SEARCHABLES = [s_name(_("Name to search by"))].freeze
|
|
@@ -24,6 +24,7 @@ module HammerCLIKatello
|
|
|
24
24
|
field :service_levels, _("Service Levels"), Fields::List
|
|
25
25
|
from :cdn_configuration do
|
|
26
26
|
label "CDN configuration", hide_blank: true do
|
|
27
|
+
field :type_label, _("Type"), Fields::Field
|
|
27
28
|
field :url, _("URL"), Fields::Field, hide_blank: true
|
|
28
29
|
field :upstream_organization_label, _("Upstream Organization"),
|
|
29
30
|
Fields::Field, hide_blank: true
|
|
@@ -39,9 +40,19 @@ module HammerCLIKatello
|
|
|
39
40
|
else
|
|
40
41
|
_("Disabled")
|
|
41
42
|
end
|
|
43
|
+
setup_cdn_type(data)
|
|
42
44
|
data
|
|
43
45
|
end
|
|
44
46
|
|
|
47
|
+
def setup_cdn_type(data)
|
|
48
|
+
types = {
|
|
49
|
+
'export_sync' => _("Export Sync"),
|
|
50
|
+
'network_sync' => _("Network Sync"),
|
|
51
|
+
'redhat_cdn' => _("Red Hat CDN")
|
|
52
|
+
}
|
|
53
|
+
data["cdn_configuration"].merge!("type_label" => types[data["cdn_configuration"]["type"]])
|
|
54
|
+
end
|
|
55
|
+
|
|
45
56
|
build_options
|
|
46
57
|
end
|
|
47
58
|
|
|
@@ -56,7 +56,7 @@ module HammerCLIKatello
|
|
|
56
56
|
field :_redhat_repo, _("Red Hat Repository")
|
|
57
57
|
field :content_type, _("Content Type")
|
|
58
58
|
field :checksum_type, _("Checksum Type"), Fields::Field, :hide_blank => true
|
|
59
|
-
field :
|
|
59
|
+
field :_mirroring_policy, _("Mirroring Policy"), Fields::Field, :hide_blank => true
|
|
60
60
|
field :url, _("Url")
|
|
61
61
|
field :_publish_via_http, _("Publish Via HTTP")
|
|
62
62
|
field :full_path, _("Published At")
|
|
@@ -126,6 +126,7 @@ module HammerCLIKatello
|
|
|
126
126
|
|
|
127
127
|
setup_sync_state(data)
|
|
128
128
|
setup_booleans(data)
|
|
129
|
+
setup_mirroring_policy(data)
|
|
129
130
|
setup_content_counts(data) if data["content_counts"]
|
|
130
131
|
data
|
|
131
132
|
end
|
|
@@ -133,7 +134,16 @@ module HammerCLIKatello
|
|
|
133
134
|
def setup_booleans(data)
|
|
134
135
|
data["_redhat_repo"] = data.dig("product", "redhat") ? _("yes") : _("no")
|
|
135
136
|
data["_publish_via_http"] = data["unprotected"] ? _("yes") : _("no")
|
|
136
|
-
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def setup_mirroring_policy(data)
|
|
140
|
+
policies = {
|
|
141
|
+
'additive' => _("Additive"),
|
|
142
|
+
'mirror_content_only' => _("Content Only"),
|
|
143
|
+
'mirror_complete' => _("Complete Mirroring")
|
|
144
|
+
}
|
|
145
|
+
mirroring_policy = data["mirroring_policy"]
|
|
146
|
+
data["_mirroring_policy"] = policies[mirroring_policy]
|
|
137
147
|
end
|
|
138
148
|
|
|
139
149
|
def setup_sync_state(data)
|
|
@@ -557,6 +567,33 @@ module HammerCLIKatello
|
|
|
557
567
|
end
|
|
558
568
|
end
|
|
559
569
|
|
|
570
|
+
class RepublishCommand < HammerCLIKatello::SingleResourceCommand
|
|
571
|
+
extend RepositoryScopedToProduct
|
|
572
|
+
include HammerCLIForemanTasks::Async
|
|
573
|
+
include OrganizationOptions
|
|
574
|
+
|
|
575
|
+
validate_repo_name_requires_product_options
|
|
576
|
+
action :republish
|
|
577
|
+
command_name "republish"
|
|
578
|
+
desc _("Forces a republish of the specified repository.")
|
|
579
|
+
|
|
580
|
+
success_message _("Repository republished.")
|
|
581
|
+
failure_message _("Could not republish the repository.")
|
|
582
|
+
|
|
583
|
+
validate_options :before, 'IdResolution' do
|
|
584
|
+
organization_options = [:option_organization_id, :option_organization_name, \
|
|
585
|
+
:option_organization_label]
|
|
586
|
+
|
|
587
|
+
if option(:option_product_name).exist?
|
|
588
|
+
any(*organization_options).required
|
|
589
|
+
end
|
|
590
|
+
end
|
|
591
|
+
|
|
592
|
+
build_options do |o|
|
|
593
|
+
o.expand.including(:products)
|
|
594
|
+
end
|
|
595
|
+
end
|
|
596
|
+
|
|
560
597
|
class ReclaimSpaceCommand < HammerCLIKatello::SingleResourceCommand
|
|
561
598
|
extend RepositoryScopedToProduct
|
|
562
599
|
include HammerCLIForemanTasks::Async
|