Always return Resource from ResourceDefinition.dependencies()

Don't assume that function.dependencies() always returns the Resource
object from the provided Stack. (In the future it will return a
ResourceProxy object.) Instead, look up the Resource object we want from
the Stack, as we do with e.g. explicit dependencies (depends_on).

Change-Id: I46d74f760c7222ba3c54ed10beb829bd7ea7746f
Partially-Implements: blueprint stack-definition
This commit is contained in:
Zane Bitter 2017-07-19 17:35:40 -04:00
parent 633f4c9f00
commit db989b64ce
1 changed files with 2 additions and 1 deletions

View File

@ -220,7 +220,8 @@ class ResourceDefinition(object):
def strict_func_deps(data, datapath):
return six.moves.filter(
lambda r: getattr(r, 'strict_dependency', True),
function.dependencies(data, datapath))
six.moves.map(lambda rp: stack[rp.name],
function.dependencies(data, datapath)))
explicit_depends = [] if self._depends is None else self._depends
prop_deps = strict_func_deps(self._properties, path('Properties'))