foreman-tasks 8.3.2 → 8.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/assets/javascripts/foreman-tasks/locale/de/foreman_tasks.js +899 -1
- data/app/assets/javascripts/foreman-tasks/locale/en/foreman_tasks.js +899 -1
- data/app/assets/javascripts/foreman-tasks/locale/es/foreman_tasks.js +900 -1
- data/app/assets/javascripts/foreman-tasks/locale/fr/foreman_tasks.js +900 -1
- data/app/assets/javascripts/foreman-tasks/locale/ja/foreman_tasks.js +898 -1
- data/app/assets/javascripts/foreman-tasks/locale/ka/foreman_tasks.js +899 -1
- data/app/assets/javascripts/foreman-tasks/locale/ko/foreman_tasks.js +899 -1
- data/app/assets/javascripts/foreman-tasks/locale/pt_BR/foreman_tasks.js +900 -1
- data/app/assets/javascripts/foreman-tasks/locale/ru/foreman_tasks.js +899 -1
- data/app/assets/javascripts/foreman-tasks/locale/zh_CN/foreman_tasks.js +898 -1
- data/app/assets/javascripts/foreman-tasks/locale/zh_TW/foreman_tasks.js +899 -1
- data/app/lib/actions/bulk_action.rb +4 -1
- data/app/lib/actions/trigger_proxy_batch.rb +13 -8
- data/lib/foreman_tasks/version.rb +1 -1
- data/locale/action_names.rb +2 -0
- data/locale/de/foreman_tasks.po +36 -0
- data/locale/en/foreman_tasks.po +36 -1
- data/locale/es/foreman_tasks.po +36 -0
- data/locale/foreman_tasks.pot +70 -8
- data/locale/fr/foreman_tasks.po +36 -0
- data/locale/ja/foreman_tasks.po +36 -0
- data/locale/ka/foreman_tasks.po +36 -0
- data/locale/ko/foreman_tasks.po +36 -0
- data/locale/pt_BR/foreman_tasks.po +36 -0
- data/locale/ru/foreman_tasks.po +36 -0
- data/locale/zh_CN/foreman_tasks.po +36 -0
- data/locale/zh_TW/foreman_tasks.po +36 -0
- data/test/unit/actions/bulk_action_test.rb +27 -0
- data/test/unit/actions/trigger_proxy_batch_test.rb +7 -0
- metadata +2 -2
@@ -16,6 +16,12 @@ module ForemanTasks
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
class KwArgChildAction < Actions::EntryAction
|
20
|
+
def plan(_target, options = {})
|
21
|
+
plan_self(kw_string: options['kw'], kw_symbol: options[:kw])
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
19
25
|
describe Actions::BulkAction do
|
20
26
|
include ForemanTasks::TestHelpers::WithInThreadExecutor
|
21
27
|
|
@@ -46,6 +52,27 @@ module ForemanTasks
|
|
46
52
|
_(success.count).must_equal 4
|
47
53
|
_(failed.count).must_equal 1
|
48
54
|
end
|
55
|
+
|
56
|
+
specify "it handles keyword arguments as indifferent hashes when they're being flattened" do
|
57
|
+
Target.expects(:unscoped).returns(Target)
|
58
|
+
Target.expects(:where).with(:id => targets.map(&:id)).returns(targets)
|
59
|
+
|
60
|
+
triggered = ForemanTasks.trigger(ParentAction, KwArgChildAction, targets, kw: 7)
|
61
|
+
task = ForemanTasks::Task.where(:external_id => triggered.id).first
|
62
|
+
wait_for { task.reload.state == 'stopped' }
|
63
|
+
task = task.sub_tasks.first
|
64
|
+
_(task.input[:kw_string]).must_equal 7
|
65
|
+
_(task.input[:kw_symbol]).must_equal 7
|
66
|
+
end
|
67
|
+
|
68
|
+
specify 'it allows setting concurrency limit' do
|
69
|
+
Target.expects(:unscoped).returns(Target)
|
70
|
+
Target.expects(:where).with(:id => targets.map(&:id)).returns(targets)
|
71
|
+
|
72
|
+
triggered = ForemanTasks.trigger(ParentAction, ChildAction, targets, concurrency_limit: 25)
|
73
|
+
task = ForemanTasks::Task.where(:external_id => triggered.id).first
|
74
|
+
_(task.execution_plan.entry_action.concurrency_limit).must_equal 25
|
75
|
+
end
|
49
76
|
end
|
50
77
|
end
|
51
78
|
end
|
@@ -32,6 +32,13 @@ module ForemanTasks
|
|
32
32
|
triggered.output[:planned_count] = ((total_count - 1) / batch_size) * batch_size
|
33
33
|
run_action(triggered)
|
34
34
|
end
|
35
|
+
|
36
|
+
it "finishes after the last batch even if the counts don't match" do
|
37
|
+
Actions::TriggerProxyBatch.any_instance.expects(:trigger_remote_tasks_batch).once
|
38
|
+
triggered.output[:planned_count] = 0
|
39
|
+
action = run_action(triggered, Actions::TriggerProxyBatch::TriggerLastBatch)
|
40
|
+
_(action.state).must_equal :success
|
41
|
+
end
|
35
42
|
end
|
36
43
|
|
37
44
|
describe '#trigger_remote_tasks_batch' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.3.
|
4
|
+
version: 8.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dynflow
|