diff --git a/heat/engine/resources/swift.py b/heat/engine/resources/swift.py index c7d433ea0..985ce6b09 100644 --- a/heat/engine/resources/swift.py +++ b/heat/engine/resources/swift.py @@ -14,7 +14,6 @@ from six.moves.urllib import parse as urlparse from swiftclient import exceptions as swift_exceptions -from heat.common import exception from heat.engine import attributes from heat.engine import properties from heat.engine import resource @@ -152,7 +151,7 @@ class SwiftContainer(resource.Resource): def FnGetRefId(self): return unicode(self.resource_id) - def FnGetAtt(self, key): + def _resolve_attribute(self, key): parsed = list(urlparse.urlparse(self.swift().url)) if key == self.DOMAIN_NAME: return parsed[1].split(':')[0] @@ -175,9 +174,6 @@ class SwiftContainer(resource.Resource): return headers['x-container-bytes-used'] elif key == self.HEAD_CONTAINER: return headers - else: - raise exception.InvalidTemplateAttribute(resource=self.name, - key=key) def resource_mapping(): diff --git a/heat/tests/test_swift.py b/heat/tests/test_swift.py index c80074790..eb66a55be 100644 --- a/heat/tests/test_swift.py +++ b/heat/tests/test_swift.py @@ -15,6 +15,7 @@ import mox import swiftclient.client as sc +from heat.common import exception from heat.common import template_format from heat.engine.resources import swift from heat.engine import scheduler @@ -148,7 +149,7 @@ class swiftTest(HeatTestCase): self.assertEqual('17680980', rsrc.FnGetAtt('BytesUsed')) self.assertEqual(headers, rsrc.FnGetAtt('HeadContainer')) - self.assertRaises(swift.exception.InvalidTemplateAttribute, + self.assertRaises(exception.InvalidTemplateAttribute, rsrc.FnGetAtt, 'Foo') scheduler.TaskRunner(rsrc.delete)()