Raise HTTPNotFound if not in create or adopt

We should raise exception when stack not found, if it's not waiting
for create or adopt (which should be the only two possible reason
that stack may not have been created yet).

Change-Id: I6c13ba8ab1b0e312a0932c40f7e9e2b7f92822c3
This commit is contained in:
ricolin 2017-10-09 11:34:11 +08:00 committed by Rico Lin
parent bdade04310
commit 920d8b72cc
1 changed files with 5 additions and 0 deletions

View File

@ -350,6 +350,11 @@ class HeatIntegrationTest(testscenarios.WithScenarios,
except heat_exceptions.HTTPNotFound:
if success_on_not_found:
return
elif not any(s in status for s in ['CREATE', 'ADOPT']):
# raise exception when stack not found, if it's not
# in create or adopt (which should be the only two possible
# reason that stack may not have been created yet)
raise
# ignore this, as the resource may not have
# been created yet
else: