summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Hardy <shardy@redhat.com>2012-07-30 18:53:23 +0100
committerSteven Hardy <shardy@redhat.com>2012-07-30 18:59:25 +0100
commit2779760de5d47d7368e541a5a631b041ca4eda1b (patch)
tree24ef5a8753197e6a9e0e13fd97938f8f07a8db7a
parent8f0caacf8a93bb515b75803e1a53692e4d4deaf0 (diff)
downloadheat-5.release.tar.gz
heat engine : Avoid writing to class-scope parameters schemav5.releasev5-branch-eol
Fixes issue where multiple instances of the same resource types which have different parameters break, because the parser is writing back to the class-scope properties_schema which should be immutable. This patch fixes by making a per-instance copy. Fixes #183 Change-Id: Ia29f67465acbcfaf8dfe511ddaa9075bc48157ad Signed-off-by: Steven Hardy <shardy@redhat.com>
-rw-r--r--heat/engine/checkeddict.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/heat/engine/checkeddict.py b/heat/engine/checkeddict.py
index 90a04174c..daef65867 100644
--- a/heat/engine/checkeddict.py
+++ b/heat/engine/checkeddict.py
@@ -15,6 +15,7 @@
import collections
import re
+from copy import deepcopy
from heat.openstack.common import log as logging
@@ -28,7 +29,7 @@ class CheckedDict(collections.MutableMapping):
self.name = name
def addschema(self, key, schema):
- self.data[key] = schema
+ self.data[key] = deepcopy(schema)
def get_attr(self, key, attr):
return self.data[key].get(attr, '')
@@ -156,7 +157,7 @@ class CheckedDict(collections.MutableMapping):
class Properties(CheckedDict):
def __init__(self, name, schema):
CheckedDict.__init__(self, name)
- self.data = schema
+ self.data = deepcopy(schema)
# set some defaults
for s in self.data: