sfpagent 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sfpagent might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/sfpagent/bsig.rb +9 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 379783979940f9c3e00cb6d7d87cfe70f2141394
|
4
|
+
data.tar.gz: 3de89027212aa57b1f7e19f06af789c108711470
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 779c7727e036da6f400cc9a2237f03ee609d54b9fb7f8dacc781720be30ef89b76e53ab999b205f59b894d7991ba1057c71b346562942ea091b0d552492f4f1d
|
7
|
+
data.tar.gz: 17de98cf9906dfaba55362a4a2948606e150185a53a841552a00b4e5232ce53cfdb15a7e4c809ca1d9042c2238ee127fe3b21325e6a5f8f74e15f34337afe639
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.8
|
data/lib/sfpagent/bsig.rb
CHANGED
@@ -144,19 +144,17 @@ class Sfp::BSig
|
|
144
144
|
def parallel_achieve_local_goal(id, goal, operators, pi, mode)
|
145
145
|
current = get_current_state
|
146
146
|
flaws = compute_flaws(goal, current)
|
147
|
-
#Sfp::Agent.logger.info "[#{mode}] flaws: #{flaws.inspect}"
|
148
147
|
|
149
148
|
return :no_flaw if flaws.length <= 0
|
150
149
|
|
151
|
-
|
152
|
-
return :failure if
|
150
|
+
selected_operators = select_operators(flaws, operators, pi)
|
151
|
+
return :failure if selected_operators == :failure
|
153
152
|
|
154
|
-
Sfp::Agent.logger.info "total operators: #{
|
153
|
+
Sfp::Agent.logger.info "total operators: #{selected_operators.length}"
|
155
154
|
|
156
|
-
total = operators.length
|
157
155
|
status = []
|
158
156
|
lock = Mutex.new
|
159
|
-
|
157
|
+
selected_operators.each do |operator|
|
160
158
|
Thread.new {
|
161
159
|
begin
|
162
160
|
stat = execute_operator(operator, id, operators, mode)
|
@@ -168,7 +166,7 @@ class Sfp::BSig
|
|
168
166
|
lock.synchronize { status << stat }
|
169
167
|
}
|
170
168
|
end
|
171
|
-
wait? { status.length >=
|
169
|
+
wait? { (status.length >= selected_operators.length) }
|
172
170
|
Sfp::Agent.logger.info "[#{mode}] exec status: #{status.inspect}"
|
173
171
|
status.each { |stat|
|
174
172
|
return :failure if stat == :failure
|
@@ -460,7 +458,10 @@ class Sfp::BSig
|
|
460
458
|
end
|
461
459
|
break if repaired.length >= flaws.length
|
462
460
|
end
|
463
|
-
|
461
|
+
if selected_operators.length <= 0 #repaired.length < flaws.length
|
462
|
+
Sfp::Agent.logger.error "No flaws can be repaired - pi=#{pi}\nflaws: #{flaws.inspect}"
|
463
|
+
return :failure
|
464
|
+
end
|
464
465
|
selected_operators
|
465
466
|
end
|
466
467
|
|