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
This commit is contained in:
Stan Lagun 2016-03-18 16:54:47 +03:00
parent 17622c8f33
commit 5fcbdccbed
2 changed files with 3 additions and 3 deletions

View File

@ -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')

View File

@ -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: