heat engine : Avoid writing to class-scope parameters schema
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>
This commit is contained in:
parent
8f0caacf8a
commit
2779760de5
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue