foreman-tasks 9.0.2 → 9.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8322a4e8ba0d11f3c42f280aac381bca0f7dd22acef9d5a8e97f5a423ff21abe
4
- data.tar.gz: 3b629102e3cab124cce9ecb13b6c7da68861aa4761eb9269ec62ff548debe114
3
+ metadata.gz: 959e8a5bbb07d3d1b6b0d1f0b57f502b4397d5797ccc3037b1e9f77a8229b06a
4
+ data.tar.gz: f0bef4b1aca4d471a2616e6b41751f1da2165eb23d9da65be87bf055bc4fab05
5
5
  SHA512:
6
- metadata.gz: a85e944aabed1bec415c23b7997104b1482e902f3f02f38afa054470967476e19e2524a6e0a7d7de2ab34e9b0e8a97c15d830f3063bf8dfffe70efc414356ca5
7
- data.tar.gz: 6859b7ae41d57e95481f82d4d5c8716d79f292d4362fda88db5bd930127864c6d39a69e0a353a34e95e09f15518f46dd053e4dae9dd2b67f7f4bbf54641c1e9f
6
+ metadata.gz: 2740338c22e5f0371358d037212a2964d4a46119dd2d2275dc290b91742be20bdd2b74ef8b9b036f60e975b4e798424b20776eabfeaa9f49049f24a2389d48c7
7
+ data.tar.gz: 43ae242cf9b8d2e7e873ab9fa99b5be157d1f9467e931d163ccf0e831d1e1969cd81ceb0391d1397f1d6606ee159b62e88e97202ddeac112579a34cc74f3d698
data/.rubocop.yml CHANGED
@@ -10,7 +10,7 @@ AllCops:
10
10
  - 'node_modules/**/*'
11
11
  - 'locale/*'
12
12
  - 'vendor/**/*'
13
- TargetRubyVersion: 2.5
13
+ TargetRubyVersion: 2.7
14
14
 
15
15
  Lint/ShadowingOuterLocalVariable:
16
16
  Enabled: false
@@ -9,7 +9,8 @@ module Actions
9
9
  # Arguments that all the targets share
10
10
  def plan(action_class, targets, *args, concurrency_limit: nil, **kwargs)
11
11
  check_targets!(targets)
12
- limit_concurrency_level!(concurrency_limit) if concurrency_limit
12
+ extracted_concurrency_limit = extract_concurrency_limit(args, concurrency_limit)
13
+ limit_concurrency_level!(extracted_concurrency_limit) if extracted_concurrency_limit
13
14
  plan_self(:action_class => action_class.to_s,
14
15
  :target_ids => targets.map(&:id),
15
16
  :target_class => targets.first.class.to_s,
@@ -72,5 +73,11 @@ module Actions
72
73
  def total_count
73
74
  input[:target_ids].count
74
75
  end
76
+
77
+ private
78
+
79
+ def extract_concurrency_limit(args = [], limit = nil)
80
+ args.find { |arg| arg.is_a?(Hash) && arg.key?(:concurrency_limit) }&.fetch(:concurrency_limit) || limit
81
+ end
75
82
  end
76
83
  end
@@ -23,12 +23,12 @@ module ForemanTasks
23
23
  # @override
24
24
  def destroy_action; end
25
25
 
26
- def save(*args)
27
- dynflow_task_wrap(:save) { super(*args) }
26
+ def save(...)
27
+ dynflow_task_wrap(:save) { super(...) }
28
28
  end
29
29
 
30
- def save!(*args)
31
- dynflow_task_wrap(:save) { super(*args) }
30
+ def save!(...)
31
+ dynflow_task_wrap(:save) { super(...) }
32
32
  end
33
33
 
34
34
  def destroy
@@ -37,14 +37,14 @@ module ForemanTasks
37
37
 
38
38
  # In order to use host.<attribute>_changed?, we must assign_attributes to
39
39
  # the host record for these update and update! methods.
40
- def update(*args)
41
- assign_attributes(*args)
40
+ def update(...)
41
+ assign_attributes(...)
42
42
  dynflow_task_wrap(:save) { save }
43
43
  end
44
44
  alias update_attributes update
45
45
 
46
- def update!(*args)
47
- assign_attributes(*args)
46
+ def update!(...)
47
+ assign_attributes(...)
48
48
  dynflow_task_wrap(:save) { save! }
49
49
  end
50
50
  alias update_attributes! update!
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = '9.0.2'.freeze
2
+ VERSION = '9.1.0'.freeze
3
3
  end
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: 9.0.2
4
+ version: 9.1.0
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: 2024-01-24 00:00:00.000000000 Z
11
+ date: 2024-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dynflow