Use StackDefinition.all_rsrc_names() API

This abstracts some internal knowledge of the various Template
implementations that hasn't become part of the public interface yet out of
ResourceDefinition and into the StackDefinition class where the current
implementation is a little more robust for third-party Template plugins,
and which can be further improved in future.

Change-Id: I01b4e6a93dc5b9f07ee0d1cad7af934ff9c9b4f0
This commit is contained in:
Zane Bitter 2017-06-28 20:53:10 -04:00
parent 6bc25ef0e0
commit 0c2e1d0c43
1 changed files with 1 additions and 1 deletions

View File

@ -255,7 +255,7 @@ class ResourceDefinition(object):
"""Return the Resource objects in given stack on which this depends.""" """Return the Resource objects in given stack on which this depends."""
def get_resource(res_name): def get_resource(res_name):
if res_name not in stack: if res_name not in stack:
if res_name in stack.t.get(stack.t.RESOURCES): if res_name in stack.defn.all_rsrc_names():
# The resource is conditionally defined, allow dependencies # The resource is conditionally defined, allow dependencies
# on it # on it
return return