foreman-tasks 12.1.0 → 12.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: faba9c8433d1b6c6faa616d7f6d58bfade42692f3e0afa6de35d67a0f1740bf2
4
- data.tar.gz: 912a3a297fde3eddbbef8fca0e3da6e2bec6e6ca5882eb69a37eafe00a443ec9
3
+ metadata.gz: 51404155da98c410758c31a9dcb5648d4fc6144823baf0f1e9917df7ecf72777
4
+ data.tar.gz: 37a731595c5e39dd3492fc51f8405bf96806f127f8c7606efe6c327c9e7a0321
5
5
  SHA512:
6
- metadata.gz: bb4842d2685129d098bb05d37a423ce7817294cf523d2dd7f4e867618d80584135564d9df7c24a460bdad68372ac663dde160189d60cdd580bce9b825d3d89f8
7
- data.tar.gz: e11dd77bbe8d94f347ed31d5b67dfec2924fba89207007fa370f7053ec5549c46a5d16e1fc34ea4e4f23ad1607abddb40db87aa74413d9b8d51f214aecab9485
6
+ metadata.gz: 2b5563312efffad6871f30a4adb94c5579d5208205e6733ed35fe52b409e1fdcb0b8d1526a71ffe3ac57d852742eabe015a21e5d4a5b1fe2f359b3f5a3915950
7
+ data.tar.gz: 60e82330e3f9eedac8729b2c5060c1597d142081287616f4ff3d284c71b5d5d39644de6072f2c825069b9d6d972d564723700dce10baa43cdaf20504208c3910
@@ -13,12 +13,6 @@ module Actions
13
13
  end
14
14
  end
15
15
 
16
- # @see Lock.lock!
17
- def lock!(resource, *_lock_names)
18
- Foreman::Deprecation.deprecation_warning('2.4', 'locking in foreman-tasks was reworked, please use a combination of exclusive_lock! and link! instead.')
19
- exclusive_lock!(resource)
20
- end
21
-
22
16
  # @see Lock.link!
23
17
  def link!(resource)
24
18
  phase! Dynflow::Action::Plan
@@ -12,26 +12,20 @@ module Actions
12
12
  end
13
13
 
14
14
  def run(*args)
15
- restore_curent_user { pass(*args) }
15
+ restore_current_user { pass(*args) }
16
16
  end
17
17
 
18
18
  def finalize
19
- current_id = User.current.try(:id)
20
- saved_id = action.input[:current_user_id]
21
- if User.current && saved_id && current_id != saved_id
22
- Foreman::Deprecation.deprecation_warning('2.5', 'relying on per-step setting of current user in finalize phase')
23
- end
24
-
25
- restore_curent_user { pass }
19
+ restore_current_user { pass }
26
20
  end
27
21
 
28
22
  def finalize_phase(execution_plan, *args)
29
- restore_curent_user(execution_plan.entry_action) { pass(execution_plan, *args) }
23
+ restore_current_user(execution_plan.entry_action) { pass(execution_plan, *args) }
30
24
  end
31
25
 
32
26
  # Run all execution plan lifecycle hooks as the original user
33
27
  def hook(*args)
34
- restore_curent_user { pass(*args) }
28
+ restore_current_user { pass(*args) }
35
29
  end
36
30
 
37
31
  private
@@ -40,7 +34,7 @@ module Actions
40
34
  if User.current || action.input[:current_user_id].nil?
41
35
  yield
42
36
  else
43
- restore_curent_user { yield }
37
+ restore_current_user { yield }
44
38
  end
45
39
  end
46
40
 
@@ -48,7 +42,7 @@ module Actions
48
42
  action.input[:current_user_id] = User.current.try(:id)
49
43
  end
50
44
 
51
- def restore_curent_user(action = self.action)
45
+ def restore_current_user(action = self.action)
52
46
  old_user = User.current
53
47
  User.current = User.unscoped.find(action.input[:current_user_id]) if action.input[:current_user_id].present?
54
48
  yield
@@ -1,3 +1,3 @@
1
1
  module ForemanTasks
2
- VERSION = '12.1.0'.freeze
2
+ VERSION = '12.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.1.0
4
+ version: 12.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Nečas