Make Functions unhashable

Remove the incorrect __hash__ function added to the Function class in
46233d2c2a and make the class unhashable. Fix
the one place we were trying to hash it, which is when it appeared in the
deletion_policy of a resource.

Change-Id: I3d47c99470a2404183bccb80269a18623aa79041
This commit is contained in:
Zane Bitter 2016-02-16 23:41:08 -05:00
parent d60d47b23f
commit 46ac8ea00c
2 changed files with 2 additions and 3 deletions

View File

@ -123,8 +123,7 @@ class Function(object):
return NotImplemented
return not eq
def __hash__(self):
return id(self)
__hash__ = None
def resolve(snippet):

View File

@ -85,7 +85,7 @@ class ResourceDefinitionCore(object):
if deletion_policy is not None:
assert deletion_policy in self.DELETION_POLICIES
self._hash ^= hash(deletion_policy)
self._hash ^= _hash_data(deletion_policy)
if update_policy is not None:
assert isinstance(update_policy, (collections.Mapping,