Merge "Catch NotFound when listing events during updates"

This commit is contained in:
Jenkins 2016-03-21 12:00:03 +00:00 committed by Gerrit Code Review
commit d5b5d35efe
1 changed files with 9 additions and 4 deletions

View File

@ -18,6 +18,8 @@ import logging
import re
import time
import heatclient.exc
LOG = logging.getLogger(__name__)
@ -134,10 +136,13 @@ class StackUpdateManager(object):
stack_name, stack_id = next(
x['href'] for x in res.links if
x['rel'] == 'stack').rsplit('/', 2)[1:]
events = self.heatclient.events.list(
stack_id=stack_id,
resource_name=res.logical_resource_id,
sort_dir='asc')
try:
events = self.heatclient.events.list(
stack_id=stack_id,
resource_name=res.logical_resource_id,
sort_dir='asc')
except heatclient.exc.HTTPNotFound:
events = []
state = 'not_started'
for ev in events:
# ignore events older than start of the last stack change