Do not presume messages in result

Sometimes we may have no messages array,
and this check for a validating job fails.

Fix this by skipping the next task if no pointer to next
task can be found.

Change-Id: I8d8e8ad6bfe9b70e7643ae84da9f3c7779eda55e
This commit is contained in:
Jarrod Johnson 2023-11-14 11:37:26 -05:00
parent b91ea93fe7
commit a93437c7e4
3 changed files with 6 additions and 3 deletions

View File

@ -2072,7 +2072,8 @@ class XCCClient(IMMClient):
complete = state == 'Completed'
progress({'phase': phase, 'progress': pct})
if complete:
if 'OperationTransitionedToJob' in pgress['Messages'][0]['MessageId']:
msgs = pgress.get('Messages', [])
if msgs and 'OperationTransitionedToJob' in msgs[0].get('MessageId', ''):
monitorurl = pgress['Messages'][0]['MessageArgs'][0]
phase = 'validating'
statetype = 'JobState'

View File

@ -836,7 +836,8 @@ class OEMHandler(object):
complete = state == 'Completed'
progress({'phase': phase, 'progress': pct})
if complete:
if 'OperationTransitionedToJob' in pgress['Messages'][0]['MessageId']:
msgs = pgress.get('Messages', [])
if msgs and 'OperationTransitionedToJob' in msgs[0].get('MessageId', ''):
monitorurl = pgress['Messages'][0]['MessageArgs'][0]
phase = 'validating'
statetype = 'JobState'

View File

@ -1278,7 +1278,8 @@ class OEMHandler(generic.OEMHandler):
complete = state == 'Completed'
progress({'phase': phase, 'progress': pct})
if complete:
if 'OperationTransitionedToJob' in pgress['Messages'][0]['MessageId']:
msgs = pgress.get('Messages', [])
if msgs and 'OperationTransitionedToJob' in msgs[0].get('MessageId', ''):
monitorurl = pgress['Messages'][0]['MessageArgs'][0]
phase = 'validating'
statetype = 'JobState'