From 69b359e47daf83e0b620ae248eca3d394e9c05cf Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Tue, 8 Jan 2013 15:47:55 +0000 Subject: [PATCH] heat engine : allow NestedStack template validation to work Nested stack templates (e.g WordPress_Composed_Instances.template) will currently fail validation because FnGetAtt attempts to get outputs for a stack which doesn't yet exist. So add a fallback which returns a string "None" for Outputs.* which will allow template validation to succeed, and will still return the actual output when the nested stack has actually been created. fixes bug 1097290 Change-Id: Ic3f48cfc2f047c104946d6dde533143d0d91a32c Signed-off-by: Steven Hardy --- heat/engine/resources/stack.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/heat/engine/resources/stack.py b/heat/engine/resources/stack.py index a3ea872b..2d1d7491 100644 --- a/heat/engine/resources/stack.py +++ b/heat/engine/resources/stack.py @@ -65,6 +65,8 @@ class Stack(resource.Resource): def get_output(self, op): stack = self.nested() + if not stack: + return None if op not in stack.outputs: raise exception.InvalidTemplateAttribute( resource=self.physical_resource_name(), key=key) @@ -105,7 +107,7 @@ class NestedStack(Stack): resource=self.physical_resource_name(), key=key) prefix, dot, op = key.partition('.') - return self.get_output(op) + return unicode(self.get_output(op)) def resource_mapping(): -- 2.45.2