Merge "Remove implementation_signature check"

This commit is contained in:
Jenkins 2016-02-03 16:39:25 +00:00 committed by Gerrit Code Review
commit 260eacd68b
4 changed files with 0 additions and 48 deletions

View File

@ -427,15 +427,6 @@ class Resource(object):
else:
return ri.name == resource_type
def implementation_signature(self):
"""Return a tuple defining the implementation.
This should be broken down into a definition and an
implementation version.
"""
return (self.__class__.__name__, self.support_status.version)
def identifier(self):
"""Return an identifier for this resource."""
return identifier.ResourceIdentifier(resource_name=self.name,
@ -865,15 +856,6 @@ class Resource(object):
and self.status == self.COMPLETE):
raise exception.UpdateReplace(self)
if prev_resource is not None:
cur_class_def, cur_ver = self.implementation_signature()
prev_class_def, prev_ver = prev_resource.implementation_signature()
if prev_class_def != cur_class_def:
raise exception.UpdateReplace(self.name)
if prev_ver != cur_ver:
return True
if before != after.freeze():
return True

View File

@ -11,12 +11,10 @@
# License for the specific language governing permissions and limitations
# under the License.
import hashlib
import json
from oslo_config import cfg
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import excutils
import six
@ -531,12 +529,3 @@ class StackResource(resource.Resource):
def _resolve_attribute(self, name):
return self.get_output(name)
def implementation_signature(self):
schema_names = ([prop for prop in self.properties_schema] +
[at for at in self.attributes_schema])
schema_hash = hashlib.sha256(';'.join(schema_names))
definition = {'template': self.child_template(),
'files': self.stack.t.files}
definition_hash = hashlib.sha256(jsonutils.dumps(definition))
return (schema_hash.hexdigest(), definition_hash.hexdigest())

View File

@ -178,10 +178,6 @@ class TemplateResource(stack_resource.StackResource):
self._get_resource_info(definition)
self._generate_schema(definition)
def implementation_signature(self):
self._generate_schema(self.t)
return super(TemplateResource, self).implementation_signature()
def template_data(self):
# we want to have the latest possible template.
# 1. look in files

View File

@ -19,7 +19,6 @@ from oslo_config import cfg
from oslo_messaging import exceptions as msg_exceptions
from oslo_serialization import jsonutils
import six
import testtools
from heat.common import exception
from heat.common import template_format
@ -207,20 +206,6 @@ class StackResourceTest(StackResourceBaseTest):
self.assertEqual(0, delete_nested.call_count)
@testtools.skipIf(six.PY3, "needs a separate change")
def test_implementation_signature(self):
self.parent_resource.child_template = mock.Mock(
return_value=self.simple_template)
sig1, sig2 = self.parent_resource.implementation_signature()
self.assertEqual('7b0eaabb5b82b9e90804d42e0bb739035588cb797'
'82427770646686ca2235028', sig1)
self.assertEqual('8fa647d036b8f36909386e1e1004539dfae7a8e88'
'c24aac0d85399e881421301', sig2)
self.parent_stack.t.files["foo"] = "bar"
sig1a, sig2a = self.parent_resource.implementation_signature()
self.assertEqual(sig1, sig1a)
self.assertNotEqual(sig2, sig2a)
def test_propagated_files(self):
"""Test passing of the files map in the top level to the child.