foreman_remote_execution 4.5.3 → 4.5.4
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/app/helpers/concerns/foreman_remote_execution/hosts_helper_extensions.rb +5 -1
- data/app/helpers/remote_execution_helper.rb +4 -2
- data/app/lib/actions/remote_execution/run_hosts_job.rb +1 -1
- data/app/models/job_invocation_composer.rb +2 -2
- data/app/models/remote_execution_feature.rb +5 -1
- data/app/views/templates/ssh/power_action.erb +2 -0
- data/lib/foreman_remote_execution/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8db3f88983ab094bd33ad6cd7630fdc57924e73ba196b1393c1369512cbd3307
|
4
|
+
data.tar.gz: 8bdaa93cdeabbb00ff6af832842c2fc1bb6437b0f3467db511e86cf22a5742bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b03559c1efa565ec741874f4213ec86dcd4115b4dcf896c9846100033429baa5bbe1df427f8f2e4a4202d62e9dbc8768358bc3034d86362bb1d40236061c2f4
|
7
|
+
data.tar.gz: 7091c88b57902cadf6c59959563d25332a89731f9a2da44a267bcd5207611a3256c31b0971f0cd9f2dca05186a07e5f86fb1361ac47d9d69bd11d61df6628e69
|
@@ -7,7 +7,9 @@ module ForemanRemoteExecution
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def multiple_actions
|
10
|
-
|
10
|
+
res = super
|
11
|
+
res += [ [_('Schedule Remote Job'), new_job_invocation_path, false] ] if authorized_for(controller: :job_invocations, action: :new)
|
12
|
+
res
|
11
13
|
end
|
12
14
|
|
13
15
|
def schedule_job_multi_button(*args)
|
@@ -21,12 +23,14 @@ module ForemanRemoteExecution
|
|
21
23
|
end
|
22
24
|
|
23
25
|
def rex_host_features(*args)
|
26
|
+
return unless authorized_for(controller: :job_invocations, action: :create)
|
24
27
|
RemoteExecutionFeature.with_host_action_button.order(:label).map do |feature|
|
25
28
|
link_to(_('%s') % feature.name, job_invocations_path(:host_ids => [args.first.id], :feature => feature.label), :method => :post)
|
26
29
|
end
|
27
30
|
end
|
28
31
|
|
29
32
|
def schedule_job_button(*args)
|
33
|
+
return unless authorized_for(controller: :job_invocations, action: :new)
|
30
34
|
link_to(_('Schedule Remote Job'), new_job_invocation_path(:host_ids => [args.first.id]), :id => :run_button, :class => 'btn btn-default')
|
31
35
|
end
|
32
36
|
|
@@ -113,12 +113,14 @@ module RemoteExecutionHelper
|
|
113
113
|
:class => 'btn btn-danger',
|
114
114
|
:title => _('Try to cancel the job on a host'),
|
115
115
|
:disabled => !task.cancellable?,
|
116
|
-
:method => :post
|
116
|
+
:method => :post,
|
117
|
+
:remote => true)
|
117
118
|
buttons << link_to(_('Abort Job'), abort_foreman_tasks_task_path(task),
|
118
119
|
:class => 'btn btn-danger',
|
119
120
|
:title => _('Try to abort the job on a host without waiting for its result'),
|
120
121
|
:disabled => !task.cancellable?,
|
121
|
-
:method => :post
|
122
|
+
:method => :post,
|
123
|
+
:remote => true)
|
122
124
|
end
|
123
125
|
buttons
|
124
126
|
end
|
@@ -72,7 +72,7 @@ module Actions
|
|
72
72
|
|
73
73
|
def total_count
|
74
74
|
# For compatibility with already existing tasks
|
75
|
-
return output[:total_count] unless output.has_key?(:host_count) || task.pending?
|
75
|
+
return output[:total_count] || hosts.count unless output.has_key?(:host_count) || task.pending?
|
76
76
|
|
77
77
|
output[:host_count] || hosts.count
|
78
78
|
end
|
@@ -209,7 +209,7 @@ class JobInvocationComposer
|
|
209
209
|
def format_datetime(datetime)
|
210
210
|
return datetime if datetime.blank?
|
211
211
|
|
212
|
-
Time.parse(datetime).strftime('%Y-%m-%d %H:%M')
|
212
|
+
Time.parse(datetime).utc.strftime('%Y-%m-%d %H:%M')
|
213
213
|
end
|
214
214
|
end
|
215
215
|
|
@@ -296,7 +296,7 @@ class JobInvocationComposer
|
|
296
296
|
attr_reader :feature_label, :feature, :provided_inputs
|
297
297
|
|
298
298
|
def initialize(feature_label, hosts, provided_inputs = {})
|
299
|
-
@feature = RemoteExecutionFeature.feature(feature_label)
|
299
|
+
@feature = RemoteExecutionFeature.feature!(feature_label)
|
300
300
|
@provided_inputs = provided_inputs
|
301
301
|
translator = HostIdsTranslator.new(hosts)
|
302
302
|
@host_bookmark = translator.bookmark
|
@@ -20,7 +20,11 @@ class RemoteExecutionFeature < ApplicationRecord
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.feature(label)
|
23
|
-
self.find_by(label: label)
|
23
|
+
self.find_by(label: label)
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.feature!(label)
|
27
|
+
feature(label) || raise(::Foreman::Exception.new(N_('Unknown remote execution feature %s'), label))
|
24
28
|
end
|
25
29
|
|
26
30
|
def self.register(label, name, options = {})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman_remote_execution
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.5.
|
4
|
+
version: 4.5.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Foreman Remote Execution team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|