Check `resource_validate` before validate external

Check `resource_validate` first to make sure, we will not validate
external resources (which will required to provide actrual resource id to
check if existed) in template-validate.
Closes-Bug: #1654752

Change-Id: I01ee79b8a3cccb85dae23a96f56a66197187198a
This commit is contained in:
ricolin 2017-01-08 13:39:02 +08:00
parent e5238e4035
commit 116158a3b1
1 changed files with 4 additions and 5 deletions

View File

@ -840,13 +840,12 @@ class Stack(collections.Mapping):
if res.name not in unique_defn_names:
continue
try:
if res.external_id is not None:
res.validate_external()
continue
if self.resource_validate:
if res.external_id is not None:
res.validate_external()
continue
result = res.validate()
else:
elif res.external_id is None:
result = res.validate_template()
except exception.HeatException as ex:
LOG.debug('%s', ex)