From 5b6aa663f37fa0adc8f595a740b7d1e4e953288f Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Wed, 13 Apr 2016 19:49:05 -0400 Subject: [PATCH] Remove the Resource.parsed_template() method Change-Id: I99a3d889fcbbe6630567857b2dbc9c0a3a0c58b7 --- heat/engine/resource.py | 18 ------------------ heat/tests/test_resource.py | 23 ----------------------- 2 files changed, 41 deletions(-) diff --git a/heat/engine/resource.py b/heat/engine/resource.py index 2c8e6eb05b..9773a454ac 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -14,7 +14,6 @@ import base64 import contextlib import datetime as dt -import warnings import weakref from oslo_config import cfg @@ -515,23 +514,6 @@ class Resource(object): return identifier.ResourceIdentifier(resource_name=self.name, **self.stack.identifier()) - def parsed_template(self, section=None, default=None): - """Return the parsed template data for the resource. - - May be limited to only one section of the data, in which case a default - value may also be supplied. - """ - warnings.warn('Resource.parsed_template() is deprecated and will be ' - 'removed in the Ocata release. Use the ' - 'ResourceDefinition API instead.', - DeprecationWarning) - - frozen = self.t.freeze() - if section is None: - return frozen - - return frozen.get(section, default or {}) - def frozen_definition(self): if self._stored_properties_data is not None: args = {'properties': self._stored_properties_data} diff --git a/heat/tests/test_resource.py b/heat/tests/test_resource.py index ada31d34da..3213110901 100644 --- a/heat/tests/test_resource.py +++ b/heat/tests/test_resource.py @@ -589,29 +589,6 @@ class ResourceTest(common.HeatTestCase): self.assertIsNone(new_res.physical_resource_id) self.assertEqual(new_tmpl_id, new_res.current_template_id) - def test_parsed_template(self): - join_func = cfn_funcs.Join(None, - 'Fn::Join', [' ', ['bar', 'baz', 'quux']]) - tmpl = rsrc_defn.ResourceDefinition('test_resource', 'Foo', - metadata={'foo': join_func}) - res = generic_rsrc.GenericResource('test_resource', tmpl, self.stack) - - parsed_tmpl = res.parsed_template() - self.assertEqual('Foo', parsed_tmpl['Type']) - self.assertEqual('bar baz quux', parsed_tmpl['Metadata']['foo']) - - self.assertEqual({'foo': 'bar baz quux'}, - res.parsed_template('Metadata')) - self.assertEqual({'foo': 'bar baz quux'}, - res.parsed_template('Metadata', {'foo': 'bar'})) - - def test_parsed_template_default(self): - tmpl = rsrc_defn.ResourceDefinition('test_resource', 'Foo') - res = generic_rsrc.GenericResource('test_resource', tmpl, self.stack) - self.assertEqual({}, res.parsed_template('Metadata')) - self.assertEqual({'foo': 'bar'}, - res.parsed_template('Metadata', {'foo': 'bar'})) - def test_metadata_default(self): tmpl = rsrc_defn.ResourceDefinition('test_resource', 'Foo') res = generic_rsrc.GenericResource('test_resource', tmpl, self.stack)