foreman_remote_execution 1.3.2 → 1.3.3
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/controllers/job_invocations_controller.rb +5 -2
- data/app/lib/actions/remote_execution/run_hosts_job.rb +6 -6
- data/app/views/job_templates/_custom_tabs.html.erb +1 -1
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/test/unit/actions/run_hosts_job_test.rb +28 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb2c9a95f22cf5c9002035f47adfc90eee494da5
|
4
|
+
data.tar.gz: 75e9a15b54a3832e112c5b8d2706a3a353f48e86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af011f877cc95f1bf64cb3dd5c8633de7d0fd2aa6a445d15925c78950a50e636acdd298660b0c6970d2c4f17b53a492a51282004011a0fe5ac030ebed57bae3d
|
7
|
+
data.tar.gz: 4d8e436256f46a252dc95987de9e1749c41852baf2e33f837dc6465bcf802d84781ac6e5eac307b2717d2bbbd18b594cac8a9fecc1a0a6adb741edf7dfd1965f
|
@@ -43,8 +43,11 @@ class JobInvocationsController < ApplicationController
|
|
43
43
|
@job_invocation = resource_base.includes(:template_invocations => :run_host_job_task).find(params[:id])
|
44
44
|
@auto_refresh = @job_invocation.task.try(:pending?)
|
45
45
|
hosts_base = @job_invocation.targeting.hosts.authorized(:view_hosts, Host)
|
46
|
-
|
47
|
-
|
46
|
+
# There's no need to do the joining if we're not filtering
|
47
|
+
unless params[:search].nil?
|
48
|
+
hosts_base = hosts_base.joins(:template_invocations)
|
49
|
+
.where(:template_invocations => { :job_invocation_id => @job_invocation.id})
|
50
|
+
end
|
48
51
|
@hosts = hosts_base.search_for(params[:search], :order => params[:order] || 'name ASC').paginate(:page => params[:page])
|
49
52
|
end
|
50
53
|
|
@@ -7,18 +7,18 @@ module Actions
|
|
7
7
|
middleware.use Actions::Middleware::BindJobInvocation
|
8
8
|
middleware.use Actions::Middleware::RecurringLogic
|
9
9
|
|
10
|
-
def delay(delay_options, job_invocation
|
10
|
+
def delay(delay_options, job_invocation)
|
11
11
|
task.add_missing_task_groups(job_invocation.task_group)
|
12
|
-
job_invocation.targeting.resolve_hosts! if job_invocation.targeting.static?
|
13
|
-
super delay_options, job_invocation
|
12
|
+
job_invocation.targeting.resolve_hosts! if job_invocation.targeting.static? && !job_invocation.targeting.resolved?
|
13
|
+
super delay_options, job_invocation
|
14
14
|
end
|
15
15
|
|
16
|
-
def plan(job_invocation
|
16
|
+
def plan(job_invocation)
|
17
17
|
set_up_concurrency_control job_invocation
|
18
18
|
job_invocation.task_group.save! if job_invocation.task_group.try(:new_record?)
|
19
19
|
task.add_missing_task_groups(job_invocation.task_group) if job_invocation.task_group
|
20
|
-
action_subject(job_invocation)
|
21
|
-
job_invocation.targeting.resolve_hosts! if job_invocation.targeting.dynamic? || !
|
20
|
+
action_subject(job_invocation)
|
21
|
+
job_invocation.targeting.resolve_hosts! if job_invocation.targeting.dynamic? || !job_invocation.targeting.resolved?
|
22
22
|
input.update(:job_category => job_invocation.job_category)
|
23
23
|
plan_self(:job_invocation_id => job_invocation.id)
|
24
24
|
end
|
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
<%= select_f f, :provider_type, providers_options, :first, :last, :disabled => @template.locked? %>
|
17
17
|
|
18
|
-
<%= number_f f, :
|
18
|
+
<%= number_f f, :execution_timeout_interval, :disabled => @template.locked?, :label => _('Timeout to kill') %>
|
19
19
|
|
20
20
|
<div class="children_fields">
|
21
21
|
<%= new_child_fields_template(f, :template_inputs, { :partial => "template_inputs/form" }) %>
|
@@ -37,9 +37,34 @@ module ForemanRemoteExecution
|
|
37
37
|
action
|
38
38
|
end
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
context 'targeting resolving' do
|
41
|
+
let(:delayed) do
|
42
|
+
action.delay({ :start_at => Time.now.getlocal }, job_invocation)
|
43
|
+
action
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'resolves dynamic targeting in plan' do
|
47
|
+
targeting.targeting_type = 'dynamic_query'
|
48
|
+
refute targeting.resolved?
|
49
|
+
delayed
|
50
|
+
refute targeting.resolved?
|
51
|
+
planned
|
52
|
+
targeting.hosts.must_include(host)
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'resolves the hosts on static targeting in delay' do
|
56
|
+
refute targeting.resolved?
|
57
|
+
delayed
|
58
|
+
targeting.hosts.must_include(host)
|
59
|
+
# Verify Targeting#resolve_hosts! won't be hit again
|
60
|
+
targeting.expects(:resolve_hosts!).never
|
61
|
+
planned
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'resolves the hosts on static targeting in plan phase if not resolved yet' do
|
65
|
+
planned
|
66
|
+
targeting.hosts.must_include(host)
|
67
|
+
end
|
43
68
|
end
|
44
69
|
|
45
70
|
it 'triggers the RunHostJob actions on the resolved hosts in run phase' do
|
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: 1.3.
|
4
|
+
version: 1.3.3
|
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: 2017-07-
|
11
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deface
|