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
This commit is contained in:
Zane Bitter 2013-06-18 10:25:52 +02:00
parent ef5b44f083
commit 388fc1bbca
3 changed files with 3 additions and 3 deletions

View File

@ -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))

View File

@ -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 [])

View File

@ -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)