stack event loops: handle get None result
We've seen at least one case in CI of `stack` being None when polling
for stack events:
<snip>
File "openstack/cloud/_orchestration.py", line 185, in delete_stack
event_utils.poll_for_events(
File "openstack/orchestration/util/event_utils.py", line 109,
in poll_for_events
stack_status = stack['stack_status']
TypeError: 'NoneType' object is not subscriptable
Handle this case with a simple if.
Change-Id: Icce6e7b600125cf98e56d98e1c3df4177414398b
This commit is contained in:
@@ -106,6 +106,7 @@ def poll_for_events(
|
||||
if no_event_polls >= 2:
|
||||
# after 2 polls with no events, fall back to a stack get
|
||||
stack = cloud.get_stack(stack_name, resolve_outputs=False)
|
||||
if stack:
|
||||
stack_status = stack['stack_status']
|
||||
msg = msg_template % dict(name=stack_name, status=stack_status)
|
||||
if stop_check(stack_status):
|
||||
|
||||
Reference in New Issue
Block a user