From 388fc1bbca8112667948010600f372af095071a7 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Tue, 18 Jun 2013 10:25:52 +0200 Subject: [PATCH] Standardise resource names in Invalid Attribute errors These should always refer to the resource name in the template (i.e. logical resource name), and never the physcial resource name (since these errors necessarily occur during validation, before any physical resource is created). Change-Id: I6cf6625cf32a90acb27adc6348695c086dc5e119 --- heat/engine/resources/stack.py | 2 +- heat/engine/resources/user.py | 2 +- heat/engine/stack_resource.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/heat/engine/resources/stack.py b/heat/engine/resources/stack.py index c745c1f4..4366f412 100644 --- a/heat/engine/resources/stack.py +++ b/heat/engine/resources/stack.py @@ -55,7 +55,7 @@ class NestedStack(stack_resource.StackResource): def FnGetAtt(self, key): if not key.startswith('Outputs.'): raise exception.InvalidTemplateAttribute( - resource=self.physical_resource_name(), key=key) + resource=self.name, key=key) prefix, dot, op = key.partition('.') return unicode(self.get_output(op)) diff --git a/heat/engine/resources/user.py b/heat/engine/resources/user.py index 80059e1c..d09c9dd0 100644 --- a/heat/engine/resources/user.py +++ b/heat/engine/resources/user.py @@ -93,7 +93,7 @@ class User(resource.Resource): def FnGetAtt(self, key): #TODO(asalkeld) Implement Arn attribute raise exception.InvalidTemplateAttribute( - resource=self.physical_resource_name(), key=key) + resource=self.name, key=key) def access_allowed(self, resource_name): policies = (self.properties['Policies'] or []) diff --git a/heat/engine/stack_resource.py b/heat/engine/stack_resource.py index 507c0fd7..b09f4a2c 100644 --- a/heat/engine/stack_resource.py +++ b/heat/engine/stack_resource.py @@ -103,6 +103,6 @@ class StackResource(resource.Resource): return None if op not in stack.outputs: raise exception.InvalidTemplateAttribute( - resource=self.physical_resource_name(), key=op) + resource=self.name, key=op) return stack.output(op) -- 2.45.2