Handle degoverned teams in highlights extension

The highlights extension attempted to be helpful by pulling in team
details from governance into the generated highlights output. This did
not account for the possiblity that teams may actually leave official
OpenStack governance, and therefore may not have these details present
in the governance output.

This adds handling to fail gracefully in this scenario by just not
trying to include the information that is no longer there.

Change-Id: Iee97b9547a2044acd86864f788f7ba1294afbf0a
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-06-04 14:03:56 -05:00
parent e7eb3ce4b3
commit 2a590cb7fb
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8

View File

@ -467,13 +467,19 @@ class HighlightsDirective(rst.Directive):
LOG.debug('[highlights] rendering %s highlights for %s',
team.title(), series)
tdata = _GOV_DATA.get_team(team)
tdata = None
try:
tdata = GOV_DATA.get_team(team)
except:
# Team may have moved out of governance
pass
title = team.title()
if tdata.service:
if tdata and tdata.service:
title = "{} - {}".format(title, tdata.service)
result.append(title, source_name)
result.append('-' * len(title), source_name)
if tdata.mission:
if tdata and tdata.mission:
result.append(tdata.mission, source_name)
result.append('', source_name)
result.append('**Notes:**', source_name)