Fix inserting noop tasks by using active state (#36056)

This commit is contained in:
Martin Krizek 2018-06-06 12:34:25 +02:00 committed by GitHub
commit 77e2bd5f8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 186 additions and 1 deletions

View file

@ -113,7 +113,7 @@ class StrategyModule(StrategyBase):
if host_tasks_to_run:
try:
lowest_cur_block = min(
(s.cur_block for h, (s, t) in host_tasks_to_run
(iterator.get_active_state(s).cur_block for h, (s, t) in host_tasks_to_run
if s.run_state != PlayIterator.ITERATING_COMPLETE))
except ValueError:
lowest_cur_block = None
@ -125,6 +125,7 @@ class StrategyModule(StrategyBase):
for (k, v) in host_tasks_to_run:
(s, t) = v
s = iterator.get_active_state(s)
if s.cur_block > lowest_cur_block:
# Not the current block, ignore it
continue
@ -158,6 +159,7 @@ class StrategyModule(StrategyBase):
if host_state_task is None:
continue
(s, t) = host_state_task
s = iterator.get_active_state(s)
if t is None:
continue
if s.run_state == cur_state and s.cur_block == cur_block: