]> review.fuel-infra Code Review - openstack-build/heat-build.git/commit
scheduler: Fix an issue with wrappertasks and exceptions
authorZane Bitter <zbitter@redhat.com>
Wed, 12 Jun 2013 10:48:25 +0000 (12:48 +0200)
committerZane Bitter <zbitter@redhat.com>
Wed, 12 Jun 2013 10:48:25 +0000 (12:48 +0200)
commit28a0e8c900096354b2fa8ff1ed9b4008e088c3d3
treea6b229fb012bd351ca745b43d08123c27d422047
parent843d127d0b6402539ed6cd654a59ef111482cee6
scheduler: Fix an issue with wrappertasks and exceptions

Using a 'for' loop on a generator is incompatible with calling throw() on
it, because the latter causes the generator to advance to the next yield.
Consequently, ignoring an exception from a subtask in the parent task would
cause the next subtask to be skipped.

This issue does not affect any existing code to date.

The inner and outer loops should each be equivalent to the definition of
"yield from" (http://www.python.org/dev/peps/pep-0380/#formal-semantics) in
PEP 380, with the following simplifications:
 - Assume that the throw() and close() methods exist
 - Don't support send()
 - Don't support return values (these are Python 3-only feature)

Change-Id: Ie29e68d4505f667f408b67b365c37511f73372fe
heat/engine/scheduler.py
heat/tests/test_scheduler.py