katello 4.0.0.rc1 → 4.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of katello might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/stylesheets/katello/katello.scss +0 -72
- data/app/controllers/katello/api/v2/host_errata_controller.rb +1 -1
- data/app/controllers/katello/api/v2/host_packages_controller.rb +6 -6
- data/app/controllers/katello/api/v2/hosts_bulk_actions_controller.rb +1 -1
- data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +1 -1
- data/app/lib/actions/katello/agent/dispatch_history_presenter.rb +64 -0
- data/app/lib/actions/katello/agent_action.rb +107 -0
- data/app/lib/actions/katello/bulk_agent_action.rb +21 -0
- data/app/lib/actions/katello/host/erratum/applicable_errata_install.rb +1 -1
- data/app/lib/actions/katello/host/erratum/install.rb +8 -26
- data/app/lib/actions/katello/host/package/install.rb +8 -21
- data/app/lib/actions/katello/host/package/remove.rb +8 -20
- data/app/lib/actions/katello/host/package/update.rb +9 -22
- data/app/lib/actions/katello/host/package_group/install.rb +8 -21
- data/app/lib/actions/katello/host/package_group/remove.rb +8 -20
- data/app/lib/actions/pulp/consumer.rb +0 -11
- data/app/lib/katello/agent/base_message.rb +38 -0
- data/app/lib/katello/agent/client_message_handler.rb +60 -0
- data/app/lib/katello/agent/connection.rb +24 -0
- data/app/lib/katello/agent/install_errata_message.rb +25 -0
- data/app/lib/katello/agent/install_package_group_message.rb +25 -0
- data/app/lib/katello/agent/install_package_message.rb +28 -0
- data/app/lib/katello/agent/remove_package_group_message.rb +25 -0
- data/app/lib/katello/agent/remove_package_message.rb +28 -0
- data/app/lib/katello/agent/update_package_message.rb +25 -0
- data/app/lib/katello/event_daemon/services/agent_event_receiver.rb +62 -0
- data/app/lib/katello/messaging/received_message.rb +1 -1
- data/app/lib/katello/qpid/connection.rb +130 -0
- data/app/models/katello/agent/dispatch_history.rb +17 -0
- data/app/models/katello/concerns/host_managed_extensions.rb +3 -0
- data/app/models/katello/events/delete_host_agent_queue.rb +19 -0
- data/app/models/katello/ping.rb +9 -1
- data/app/models/setting/content.rb +0 -2
- data/app/services/katello/agent/dispatcher.rb +66 -0
- data/app/services/katello/candlepin_event_listener.rb +1 -0
- data/app/services/katello/event_monitor/poller_thread.rb +1 -0
- data/app/services/katello/registration_manager.rb +10 -0
- data/app/views/katello/sync_management/_products.html.erb +1 -1
- data/db/migrate/20210122200618_create_katello_agent_dispatch_history.rb +11 -0
- data/db/migrate/20210125161911_delete_erratum_install_batch_size_setting.rb +5 -0
- data/db/migrate/20210208213920_add_available_module_stream_context.rb +8 -0
- data/engines/bastion/app/assets/javascripts/bastion/auth/authorization.service.js +1 -1
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-start-date.directive.js +21 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscription-type.directive.js +16 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-start-date.html +2 -0
- data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/views/subscription-type.html +18 -0
- data/lib/katello/engine.rb +7 -0
- data/lib/katello/plugin.rb +1 -0
- data/lib/katello/tasks/reset.rake +0 -15
- data/lib/katello/version.rb +1 -1
- data/locale/bn/katello.edit.po +8538 -0
- data/locale/bn/katello.po.time_stamp +0 -0
- data/locale/cs/katello.edit.po +8440 -0
- data/locale/cs/katello.po.time_stamp +0 -0
- data/locale/de/katello.edit.po +8344 -0
- data/locale/de/katello.po.time_stamp +0 -0
- data/locale/en/katello.edit.po +8161 -0
- data/locale/en/katello.po.time_stamp +0 -0
- data/locale/es/katello.edit.po +8306 -0
- data/locale/es/katello.po.time_stamp +0 -0
- data/locale/fr/katello.edit.po +8356 -0
- data/locale/fr/katello.po.time_stamp +0 -0
- data/locale/gu/katello.edit.po +8540 -0
- data/locale/gu/katello.po.time_stamp +0 -0
- data/locale/hi/katello.edit.po +8537 -0
- data/locale/hi/katello.po.time_stamp +0 -0
- data/locale/it/katello.edit.po +8293 -0
- data/locale/it/katello.po.time_stamp +0 -0
- data/locale/ja/katello.edit.po +8322 -0
- data/locale/ja/katello.po.time_stamp +0 -0
- data/locale/kn/katello.edit.po +8538 -0
- data/locale/kn/katello.po.time_stamp +0 -0
- data/locale/ko/katello.edit.po +8289 -0
- data/locale/ko/katello.po.time_stamp +0 -0
- data/locale/mr/katello.edit.po +8502 -0
- data/locale/mr/katello.po.time_stamp +0 -0
- data/locale/or/katello.edit.po +8538 -0
- data/locale/or/katello.po.time_stamp +0 -0
- data/locale/pa/katello.edit.po +8524 -0
- data/locale/pa/katello.po.time_stamp +0 -0
- data/locale/pt/katello.edit.po +8255 -0
- data/locale/pt/katello.po.time_stamp +0 -0
- data/locale/pt_BR/katello.edit.po +8289 -0
- data/locale/pt_BR/katello.po.time_stamp +0 -0
- data/locale/ru/katello.edit.po +8309 -0
- data/locale/ru/katello.po.time_stamp +0 -0
- data/locale/ta/katello.edit.po +8536 -0
- data/locale/ta/katello.po.time_stamp +0 -0
- data/locale/te/katello.edit.po +8536 -0
- data/locale/te/katello.po.time_stamp +0 -0
- data/locale/zh_CN/katello.edit.po +8288 -0
- data/locale/zh_CN/katello.po.time_stamp +0 -0
- data/locale/zh_TW/katello.edit.po +8420 -0
- data/locale/zh_TW/katello.po.time_stamp +0 -0
- metadata +62 -12
- data/app/lib/actions/pulp/consumer/abstract_content_action.rb +0 -71
- data/app/lib/actions/pulp/consumer/content_install.rb +0 -43
- data/app/lib/actions/pulp/consumer/content_uninstall.rb +0 -26
- data/app/lib/actions/pulp/consumer/content_update.rb +0 -32
- data/db/functions/empty_v01.sql +0 -7
- data/db/functions/evr_trigger_v01.sql +0 -9
- data/db/functions/isalpha_v01.sql +0 -11
- data/db/functions/isalphanum_v01.sql +0 -12
- data/db/functions/isdigit_v01.sql +0 -10
- data/db/functions/rpmver_array_v01.sql +0 -60
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 336a4ba95971459cc367612026947e16d536f4002aa4edbbf1ef2f5c75fc8d79
|
4
|
+
data.tar.gz: bf25590898a3e0485037acb025c7d654c3a98dce1dfb2830f85db8923eb78bdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19244df2d07a33451ae52bf787b7cd5d173db7647a90b88535077e27266a14814315d7b31f124c66cad14a41eb27bdbb8e78a2fe06b900b3f931f833b89b89c6
|
7
|
+
data.tar.gz: 753d1c2598e96cdf3ce57c79abe0f997733ea296c29f5ccedafd0502530046a727be430ae87b3d4b3030415f66c9d7801f8222dca6e388c576ca6ad46766cd9b
|
@@ -163,78 +163,6 @@ input:focus {
|
|
163
163
|
@extend .status_exclamation_icon;
|
164
164
|
}
|
165
165
|
|
166
|
-
/* BUTTONS */
|
167
|
-
input[type='submit'], button, .button {
|
168
|
-
font-size: 10px;
|
169
|
-
display: inline-block;
|
170
|
-
vertical-align: bottom;
|
171
|
-
background: -moz-linear-gradient(top, #f9f9f9, #f0f0f0, #e5e5e5, #e9e9e9);
|
172
|
-
background: -webkit-gradient(linear, left top, left bottom, from(#f9f9f9), color-stop(0.9, #e5e5e5), to(#e9e9e9));
|
173
|
-
box-shadow: none;
|
174
|
-
border: 1px solid darken($stroke_color, 20%);
|
175
|
-
color: #221e1f;
|
176
|
-
cursor: pointer;
|
177
|
-
padding: 4px 8px;
|
178
|
-
border-radius: 5px;
|
179
|
-
text-shadow: 0 1px 0 rgba($white_color, 1);
|
180
|
-
min-height: 14px;
|
181
|
-
.nomargin {
|
182
|
-
margin: 0;
|
183
|
-
}
|
184
|
-
&:hover {
|
185
|
-
background: -moz-linear-gradient(top, $white_color, $white_color, #cfcfcf);
|
186
|
-
background: -webkit-gradient(linear, left top, left bottom, from($white_color), color-stop(0.6, $white_color), to(#cfcfcf));
|
187
|
-
box-shadow: 0 1px 2px rgba(0,0,0,0.5);
|
188
|
-
text-decoration: none;
|
189
|
-
color: black;
|
190
|
-
}
|
191
|
-
&:active {
|
192
|
-
background: -moz-linear-gradient(top, #c2c3c0, #e4e5e4);
|
193
|
-
background: -webkit-gradient(linear, left top, left bottom, from(#c2c3c0), to(#e4e5e4));
|
194
|
-
box-shadow: none;
|
195
|
-
text-decoration: none;
|
196
|
-
}
|
197
|
-
&:focus {
|
198
|
-
text-decoration: none;
|
199
|
-
color: #000;
|
200
|
-
border-width: 2px;
|
201
|
-
}
|
202
|
-
&.dialogbutton {
|
203
|
-
float: right;
|
204
|
-
margin-left: 3px;
|
205
|
-
margin: 40px 4px 4px;
|
206
|
-
}
|
207
|
-
&.formbutton {
|
208
|
-
display: inline-block;
|
209
|
-
margin-left: 3px;
|
210
|
-
margin: 40px 4px 4px;
|
211
|
-
}
|
212
|
-
&.actionlink {
|
213
|
-
margin: 40px 0 0;
|
214
|
-
}
|
215
|
-
&.disabled, &[disabled] {
|
216
|
-
cursor: default;
|
217
|
-
background: transparent;
|
218
|
-
opacity: 0.4;
|
219
|
-
|
220
|
-
&:hover {
|
221
|
-
background: transparent;
|
222
|
-
box-shadow: none;
|
223
|
-
}
|
224
|
-
}
|
225
|
-
&.iconbutton {
|
226
|
-
display: inline-block;
|
227
|
-
}
|
228
|
-
&.tiny {
|
229
|
-
padding: 4px;
|
230
|
-
margin: 0;
|
231
|
-
&:active, &:focus {
|
232
|
-
margin: 0;
|
233
|
-
padding: 3px;
|
234
|
-
}
|
235
|
-
}
|
236
|
-
}
|
237
|
-
|
238
166
|
table {
|
239
167
|
border-collapse: collapse;
|
240
168
|
border: 1px solid $stroke_color;
|
@@ -55,7 +55,7 @@ module Katello
|
|
55
55
|
|
56
56
|
param_group :bulk_errata_ids
|
57
57
|
def apply
|
58
|
-
task = async_task(::Actions::Katello::Host::Erratum::Install, @host, @errata_ids)
|
58
|
+
task = async_task(::Actions::Katello::Host::Erratum::Install, @host, content: @errata_ids)
|
59
59
|
respond_for_async :resource => task
|
60
60
|
end
|
61
61
|
|
@@ -33,14 +33,14 @@ module Katello
|
|
33
33
|
def install
|
34
34
|
if params[:packages]
|
35
35
|
packages = validate_package_list_format(params[:packages])
|
36
|
-
task = async_task(::Actions::Katello::Host::Package::Install, @host, packages)
|
36
|
+
task = async_task(::Actions::Katello::Host::Package::Install, @host, content: packages)
|
37
37
|
respond_for_async :resource => task
|
38
38
|
return
|
39
39
|
end
|
40
40
|
|
41
41
|
if params[:groups]
|
42
42
|
groups = extract_group_names(params[:groups])
|
43
|
-
task = async_task(::Actions::Katello::Host::PackageGroup::Install, @host, groups)
|
43
|
+
task = async_task(::Actions::Katello::Host::PackageGroup::Install, @host, content: groups)
|
44
44
|
respond_for_async :resource => task
|
45
45
|
end
|
46
46
|
end
|
@@ -51,7 +51,7 @@ module Katello
|
|
51
51
|
def upgrade
|
52
52
|
if params[:packages]
|
53
53
|
packages = validate_package_list_format(params[:packages])
|
54
|
-
task = async_task(::Actions::Katello::Host::Package::Update, @host, packages)
|
54
|
+
task = async_task(::Actions::Katello::Host::Package::Update, @host, content: packages)
|
55
55
|
respond_for_async :resource => task
|
56
56
|
end
|
57
57
|
end
|
@@ -59,7 +59,7 @@ module Katello
|
|
59
59
|
api :PUT, "/hosts/:host_id/packages/upgrade_all", N_("Update packages remotely")
|
60
60
|
param :host_id, :number, :required => true, :desc => N_("ID of the host")
|
61
61
|
def upgrade_all
|
62
|
-
task = async_task(::Actions::Katello::Host::Package::Update, @host, [])
|
62
|
+
task = async_task(::Actions::Katello::Host::Package::Update, @host, content: [])
|
63
63
|
respond_for_async :resource => task
|
64
64
|
end
|
65
65
|
|
@@ -69,14 +69,14 @@ module Katello
|
|
69
69
|
def remove
|
70
70
|
if params[:packages]
|
71
71
|
packages = validate_package_list_format(params[:packages])
|
72
|
-
task = async_task(::Actions::Katello::Host::Package::Remove, @host, packages)
|
72
|
+
task = async_task(::Actions::Katello::Host::Package::Remove, @host, content: packages)
|
73
73
|
respond_for_async :resource => task
|
74
74
|
return
|
75
75
|
end
|
76
76
|
|
77
77
|
if params[:groups]
|
78
78
|
groups = extract_group_names(params[:groups])
|
79
|
-
task = async_task(::Actions::Katello::Host::PackageGroup::Remove, @host, groups)
|
79
|
+
task = async_task(::Actions::Katello::Host::PackageGroup::Remove, @host, content: groups)
|
80
80
|
respond_for_async :resource => task
|
81
81
|
end
|
82
82
|
end
|
@@ -365,7 +365,7 @@ module Katello
|
|
365
365
|
if params[:action] == :update_content && params[:update_all]
|
366
366
|
content = []
|
367
367
|
end
|
368
|
-
task = async_task(
|
368
|
+
task = async_task(Actions::Katello::BulkAgentAction, PARAM_ACTIONS[params[:action]][params[:content_type]], @hosts, content: content)
|
369
369
|
respond_for_async :resource => task
|
370
370
|
end
|
371
371
|
end
|
@@ -126,7 +126,7 @@ module Katello
|
|
126
126
|
end
|
127
127
|
|
128
128
|
def deprecated
|
129
|
-
::Foreman::Deprecation.api_deprecation_warning("
|
129
|
+
::Foreman::Deprecation.api_deprecation_warning("This will be removed in Katello 4.2, Please see /api/v2/simple_content_access")
|
130
130
|
end
|
131
131
|
end
|
132
132
|
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module Actions
|
2
|
+
module Katello
|
3
|
+
module Agent
|
4
|
+
class DispatchHistoryPresenter
|
5
|
+
def initialize(dispatch_history, action_type)
|
6
|
+
@result = dispatch_history&.result&.with_indifferent_access
|
7
|
+
@action_type = action_type
|
8
|
+
end
|
9
|
+
|
10
|
+
def humanized_output
|
11
|
+
return if @result.empty?
|
12
|
+
|
13
|
+
result = package_result
|
14
|
+
|
15
|
+
if result[:message]
|
16
|
+
result[:message]
|
17
|
+
elsif result[:packages].any?
|
18
|
+
packages = result[:packages].map { |package| package[:qname] }
|
19
|
+
packages.sort.join("\n")
|
20
|
+
else
|
21
|
+
humanized_no_package
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def error_messages
|
26
|
+
messages = []
|
27
|
+
@result.each_value do |result|
|
28
|
+
if !result[:succeeded] && result.dig(:details, :message)
|
29
|
+
messages << result[:details][:message]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
messages
|
33
|
+
end
|
34
|
+
|
35
|
+
private
|
36
|
+
|
37
|
+
def package_result
|
38
|
+
result = { packages: [] }
|
39
|
+
|
40
|
+
@result.each_value do |v|
|
41
|
+
if v[:succeeded]
|
42
|
+
result[:packages].concat(v[:details][:resolved] + v[:details][:deps])
|
43
|
+
break
|
44
|
+
else
|
45
|
+
result[:message] = v[:details][:message]
|
46
|
+
break
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
result
|
51
|
+
end
|
52
|
+
|
53
|
+
def humanized_no_package
|
54
|
+
case @action_type
|
55
|
+
when :content_install
|
56
|
+
_("No new packages installed")
|
57
|
+
when :content_uninstall
|
58
|
+
_("No packages removed")
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -0,0 +1,107 @@
|
|
1
|
+
module Actions
|
2
|
+
module Katello
|
3
|
+
class AgentAction < Actions::EntryAction
|
4
|
+
include Dynflow::Action::Timeouts
|
5
|
+
include Helpers::Presenter
|
6
|
+
|
7
|
+
def self.agent_message
|
8
|
+
fail NotImplementedError
|
9
|
+
end
|
10
|
+
|
11
|
+
def agent_action_type
|
12
|
+
nil
|
13
|
+
end
|
14
|
+
|
15
|
+
def plan(host, options)
|
16
|
+
action_subject(host, :hostname => host.name, :content => options[:content])
|
17
|
+
|
18
|
+
# if already dispatched by bulk action use the provided history ID
|
19
|
+
dispatch_history_id = options.dig(:dispatch_histories, host.id.to_s)
|
20
|
+
|
21
|
+
unless dispatch_history_id
|
22
|
+
histories = ::Katello::Agent::Dispatcher.dispatch(
|
23
|
+
self.class.agent_message,
|
24
|
+
[host.id],
|
25
|
+
content: options[:content]
|
26
|
+
)
|
27
|
+
|
28
|
+
dispatch_history_id = histories.first.id
|
29
|
+
end
|
30
|
+
|
31
|
+
plan_self(
|
32
|
+
host_id: host.id,
|
33
|
+
dispatch_history_id: dispatch_history_id
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
def run(event = nil)
|
38
|
+
case event
|
39
|
+
when nil
|
40
|
+
history = dispatch_history
|
41
|
+
|
42
|
+
if history.finished?
|
43
|
+
fail_on_errors
|
44
|
+
return
|
45
|
+
elsif history.accepted?
|
46
|
+
schedule_timeout(finish_timeout)
|
47
|
+
else
|
48
|
+
schedule_timeout(accept_timeout)
|
49
|
+
end
|
50
|
+
|
51
|
+
suspend do |suspended_action|
|
52
|
+
history.dynflow_execution_plan_id = suspended_action.execution_plan_id
|
53
|
+
history.dynflow_step_id = suspended_action.step_id
|
54
|
+
history.save!
|
55
|
+
end
|
56
|
+
when Dynflow::Action::Timeouts::Timeout
|
57
|
+
process_timeout
|
58
|
+
when 'accepted'
|
59
|
+
schedule_timeout(finish_timeout)
|
60
|
+
suspend
|
61
|
+
else
|
62
|
+
fail_on_errors
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
def accept_timeout
|
67
|
+
Setting['content_action_accept_timeout']
|
68
|
+
end
|
69
|
+
|
70
|
+
def finish_timeout
|
71
|
+
Setting['content_action_finish_timeout']
|
72
|
+
end
|
73
|
+
|
74
|
+
def process_timeout
|
75
|
+
history = dispatch_history
|
76
|
+
|
77
|
+
unless history.accepted?
|
78
|
+
fail _("Host did not respond within %s seconds. The task has been cancelled. Is katello-agent installed and goferd running on the Host?") % accept_timeout
|
79
|
+
end
|
80
|
+
|
81
|
+
unless history.finished?
|
82
|
+
fail _("Host did not finish content action in %s seconds. The task has been cancelled.") % finish_timeout
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def fail_on_errors
|
87
|
+
errors = presenter.error_messages
|
88
|
+
|
89
|
+
if errors.any?
|
90
|
+
fail errors.join("\n")
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
def presenter
|
95
|
+
Actions::Katello::Agent::DispatchHistoryPresenter.new(dispatch_history, agent_action_type)
|
96
|
+
end
|
97
|
+
|
98
|
+
def rescue_strategy
|
99
|
+
Dynflow::Action::Rescue::Skip
|
100
|
+
end
|
101
|
+
|
102
|
+
def dispatch_history
|
103
|
+
::Katello::Agent::DispatchHistory.find_by_id(input[:dispatch_history_id])
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Actions
|
2
|
+
module Katello
|
3
|
+
class BulkAgentAction < Actions::BulkAction
|
4
|
+
def plan(agent_action, hosts, args)
|
5
|
+
host_ids = hosts.map(&:id)
|
6
|
+
dispatch_args = {
|
7
|
+
content: args[:content]
|
8
|
+
}
|
9
|
+
histories = ::Katello::Agent::Dispatcher.dispatch(agent_action.agent_message, host_ids, dispatch_args)
|
10
|
+
|
11
|
+
grouped_histories = {}
|
12
|
+
histories.each { |h| grouped_histories[h.host_id] = h.id }
|
13
|
+
options = {
|
14
|
+
dispatch_histories: grouped_histories,
|
15
|
+
content: args[:content]
|
16
|
+
}
|
17
|
+
super(agent_action, hosts, options)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -15,7 +15,7 @@ module Actions
|
|
15
15
|
if applicable_errata.empty?
|
16
16
|
plan_self(:hostname => host.name, :skip => true)
|
17
17
|
else
|
18
|
-
plan_action(Actions::Katello::Host::Erratum::Install, host, applicable_errata.pluck(:errata_id))
|
18
|
+
plan_action(Actions::Katello::Host::Erratum::Install, host, content: applicable_errata.pluck(:errata_id))
|
19
19
|
plan_self(:hostname => host.name, :skip => false)
|
20
20
|
end
|
21
21
|
end
|
@@ -2,27 +2,13 @@ module Actions
|
|
2
2
|
module Katello
|
3
3
|
module Host
|
4
4
|
module Erratum
|
5
|
-
class Install < Actions::
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
Type! host, ::Host::Managed
|
5
|
+
class Install < Actions::Katello::AgentAction
|
6
|
+
def self.agent_message
|
7
|
+
:install_errata
|
8
|
+
end
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
errata_ids.each_slice(Setting['erratum_install_batch_size']) do |errata_ids_batch|
|
14
|
-
plan_action(Pulp::Consumer::ContentInstall,
|
15
|
-
consumer_uuid: host.content_facet.uuid,
|
16
|
-
type: 'erratum',
|
17
|
-
args: errata_ids_batch)
|
18
|
-
end
|
19
|
-
else
|
20
|
-
plan_action(Pulp::Consumer::ContentInstall,
|
21
|
-
consumer_uuid: host.content_facet.uuid,
|
22
|
-
type: 'erratum',
|
23
|
-
args: errata_ids)
|
24
|
-
end
|
25
|
-
plan_self(:host_id => host.id)
|
10
|
+
def agent_action_type
|
11
|
+
:content_install
|
26
12
|
end
|
27
13
|
|
28
14
|
def humanized_name
|
@@ -34,20 +20,16 @@ module Actions
|
|
34
20
|
end
|
35
21
|
|
36
22
|
def humanized_input
|
37
|
-
[input[:
|
23
|
+
[input[:content].join(", ")] + super
|
38
24
|
end
|
39
25
|
|
40
26
|
def resource_locks
|
41
27
|
:link
|
42
28
|
end
|
43
29
|
|
44
|
-
def presenter
|
45
|
-
Helpers::Presenter::Delegated.new(self, planned_actions(Pulp::Consumer::ContentInstall))
|
46
|
-
end
|
47
|
-
|
48
30
|
def finalize
|
49
31
|
host = ::Host.find_by(:id => input[:host_id])
|
50
|
-
host.update(audit_comment: (_("Installation of errata requested: %{errata}") % {errata: input[:
|
32
|
+
host.update(audit_comment: (_("Installation of errata requested: %{errata}") % {errata: input[:content].join(", ")}).truncate(255))
|
51
33
|
end
|
52
34
|
end
|
53
35
|
end
|
@@ -2,18 +2,13 @@ module Actions
|
|
2
2
|
module Katello
|
3
3
|
module Host
|
4
4
|
module Package
|
5
|
-
class Install < Actions::
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
Type! host, ::Host::Managed
|
5
|
+
class Install < Actions::Katello::AgentAction
|
6
|
+
def self.agent_message
|
7
|
+
:install_package
|
8
|
+
end
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
consumer_uuid: host.content_facet.uuid,
|
14
|
-
type: 'rpm',
|
15
|
-
args: packages)
|
16
|
-
plan_self(:host_id => host.id)
|
10
|
+
def agent_action_type
|
11
|
+
:content_install
|
17
12
|
end
|
18
13
|
|
19
14
|
def humanized_name
|
@@ -25,20 +20,12 @@ module Actions
|
|
25
20
|
end
|
26
21
|
|
27
22
|
def humanized_input
|
28
|
-
[input[:
|
29
|
-
end
|
30
|
-
|
31
|
-
def presenter
|
32
|
-
Helpers::Presenter::Delegated.new(self, planned_actions(Pulp::Consumer::ContentInstall))
|
33
|
-
end
|
34
|
-
|
35
|
-
def rescue_strategy
|
36
|
-
Dynflow::Action::Rescue::Skip
|
23
|
+
[input[:content].join(", ")] + super
|
37
24
|
end
|
38
25
|
|
39
26
|
def finalize
|
40
27
|
host = ::Host.find_by(:id => input[:host_id])
|
41
|
-
host.update(audit_comment: (_("Installation of package(s) requested: %{packages}") % {packages: input[:
|
28
|
+
host.update(audit_comment: (_("Installation of package(s) requested: %{packages}") % {packages: input[:content].join(", ")}).truncate(255))
|
42
29
|
end
|
43
30
|
end
|
44
31
|
end
|