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
Zane Bitter 6 years ago
parent 6bc25ef0e0
commit 0c2e1d0c43

@ -255,7 +255,7 @@ class ResourceDefinition(object):
"""Return the Resource objects in given stack on which this depends."""
def get_resource(res_name):
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
# on it