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.

Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/sfpagent/bsig.rb +9 -8
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 756db80c9a4995bba51be6402b3ed1589d4dc48a
4
- data.tar.gz: a723b67ba8d1f649f8c4c2c01c9682581721970e
3
+ metadata.gz: 379783979940f9c3e00cb6d7d87cfe70f2141394
4
+ data.tar.gz: 3de89027212aa57b1f7e19f06af789c108711470
5
5
  SHA512:
6
- metadata.gz: 0db50466b23803da4ee8a613d0c506d85c0866715831d54eb6375ad4d794ab69a253060aa0ceb66348204598a9b0a0a741680dd2ba6daee3a4b4fb6216ad276f
7
- data.tar.gz: 404edcde4d8942123e912ac130d6a015a7a3317a5c565ed074732979a5bc9f13e6ff6994d09c083239e342cac0a7db38601592daf3eb3d22d1b5530d91544455
6
+ metadata.gz: 779c7727e036da6f400cc9a2237f03ee609d54b9fb7f8dacc781720be30ef89b76e53ab999b205f59b894d7991ba1057c71b346562942ea091b0d552492f4f1d
7
+ data.tar.gz: 17de98cf9906dfaba55362a4a2948606e150185a53a841552a00b4e5232ce53cfdb15a7e4c809ca1d9042c2238ee127fe3b21325e6a5f8f74e15f34337afe639
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.7
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
- operators = select_operators(flaws, operators, pi)
152
- return :failure if operators == :failure
150
+ selected_operators = select_operators(flaws, operators, pi)
151
+ return :failure if selected_operators == :failure
153
152
 
154
- Sfp::Agent.logger.info "total operators: #{operators.length}"
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
- operators.each do |operator|
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 >= operators.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
- return :failure if repaired.length < flaws.length
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfpagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Herry