From 5fcbdccbedd4c3ae9f13a30a82514cefc789c3bf Mon Sep 17 00:00:00 2001 From: Stan Lagun Date: Fri, 18 Mar 2016 16:54:47 +0300 Subject: [PATCH] Removes ability to alter defaults for child objects Previously there was a feature which allowed to set new default property values for owned objects when using class() contract. This was done using Default property keyword which served for 2 different purposes in this case. The feature was never used neither documented anywhere. And it wasn't ever really designed. It also had a bug that caused default value [] (empty list) to be replaced with {} (empty dict). But there are cases when instead of $.class() contract we have [$class()] contract and in this case default value should also be a list rather then a dictionary of property values. So the only reason some applications worked until recently was that bug. However recent refactoring reworked that code and fixed that bug. So, in turn, it broke all docker applications that implicitly relied on that bug. This commit removed the entire feature. It was never used thus will break. We can reconsider it once we have a better design and use cases for it. Change-Id: I792fbd9801ff7776ee72660b2be2f89d0bfeb132 Closes-Bug: #1558332 --- murano/dsl/helpers.py | 4 ++-- murano/dsl/type_scheme.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/murano/dsl/helpers.py b/murano/dsl/helpers.py index c30923cdf..2d8168bf7 100644 --- a/murano/dsl/helpers.py +++ b/murano/dsl/helpers.py @@ -515,7 +515,7 @@ def resolve_type(value, scope_type, return_reference=False): def instantiate(data, owner, object_store, context, scope_type, - default_type=None, defaults=None): + default_type=None): if data is None: data = {} if not isinstance(data, yaqlutils.MappingType): @@ -533,7 +533,7 @@ def instantiate(data, owner, object_store, context, scope_type, owner, object_store, object_store.executor)( context, **props) - data = evaluate(updated_dict(defaults, data), context, freeze=False) + data = evaluate(data, context, freeze=False) if '?' not in data: if not default_type: raise ValueError('Type information is missing') diff --git a/murano/dsl/type_scheme.py b/murano/dsl/type_scheme.py index 41bcee14c..b73df9d66 100644 --- a/murano/dsl/type_scheme.py +++ b/murano/dsl/type_scheme.py @@ -164,7 +164,7 @@ class TypeScheme(object): elif isinstance(value, utils.MappingType): obj = helpers.instantiate( value, owner, object_store, root_context, - calling_type, default_name, default) + calling_type, default_name) elif isinstance(value, six.string_types) and object_store: obj = object_store.get(value) if obj is None: