]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Report errors from nested stacks
authorZane Bitter <zbitter@redhat.com>
Fri, 6 Jul 2012 18:40:00 +0000 (20:40 +0200)
committerZane Bitter <zbitter@redhat.com>
Wed, 11 Jul 2012 14:13:03 +0000 (10:13 -0400)
If creation of a nested stack fails, we need to raise an exception so that
creation of the nested stack resource (and hence the enclosing stack) also
fails.

Change-Id: Ic5eda7f8d044ed2c87fc0e785b1cd8fcf78071a4
Signed-off-by: Zane Bitter <zbitter@redhat.com>
heat/engine/stack.py

index f35ae7533f6980867f60d5d5736d4ac678d71236..cbc46aed4c8ebd0aa8e534a914f26dcfe3418e33 100644 (file)
@@ -69,6 +69,8 @@ class Stack(Resource):
         nested_id = self._nested.store(self.stack)
         self.instance_id_set(nested_id)
         self._nested.create()
+        if self._nested.state != self._nested.CREATE_COMPLETE:
+            raise exception.Error(self._nested.state_description)
 
     def handle_create(self):
         response = urllib2.urlopen(self.properties[PROP_TEMPLATE_URL])