foreman-tasks 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -5,10 +5,6 @@ module ForemanTasks
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
-
before_create :before_plan_action
|
9
|
-
before_update :before_plan_action
|
10
|
-
before_destroy :before_plan_action
|
11
|
-
|
12
8
|
after_create :plan_create_action
|
13
9
|
after_update :plan_update_action
|
14
10
|
after_destroy :plan_destroy_action
|
@@ -53,17 +49,15 @@ module ForemanTasks
|
|
53
49
|
mine + mine.reduce(Set.new) { |s, resource| s + get_all_related_resources.(resource) }
|
54
50
|
end
|
55
51
|
|
56
|
-
# dynflow actions are async by default
|
57
|
-
def before_plan_action
|
58
|
-
@dynflow_sync_action = false
|
59
|
-
return true
|
60
|
-
end
|
61
|
-
|
62
52
|
# to make the triggered action synchronous
|
63
53
|
def sync_action!
|
64
54
|
@dynflow_sync_action = true
|
65
55
|
end
|
66
56
|
|
57
|
+
def sync_action_flag_reset!
|
58
|
+
@dynflow_sync_action = false
|
59
|
+
end
|
60
|
+
|
67
61
|
def create_action
|
68
62
|
end
|
69
63
|
|
@@ -133,7 +127,10 @@ module ForemanTasks
|
|
133
127
|
end
|
134
128
|
if action
|
135
129
|
ensure_not_in_transaction!
|
136
|
-
yield.tap
|
130
|
+
yield.tap do |result|
|
131
|
+
execute_planned_action if result
|
132
|
+
sync_action_flag_reset!
|
133
|
+
end
|
137
134
|
else
|
138
135
|
yield
|
139
136
|
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: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|