show the liaison name in list-changes output along with PTL

Change-Id: I4badc7032ae3f7b9e16154d9716de94e2263c26c
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-01-16 15:17:14 -05:00
parent 893343361c
commit 4adcf1b2da
2 changed files with 15 additions and 1 deletions

View File

@ -170,7 +170,8 @@ def main():
if team_dict:
team = governance.Team(team_name, team_dict)
print('found team %s' % team_name)
print(' PTL: %(name)s (%(irc)s)\n' % team.ptl)
print(' PTL : %(name)s (%(irc)s)' % team.ptl)
print(' Liaison: %s (%s)\n' % team.liaison)
deliverable_name = os.path.basename(filename)[:-5] # remove .yaml
deliverable = team.deliverables.get(deliverable_name)
if deliverable:

View File

@ -15,6 +15,8 @@
import weakref
from openstack_releases import wiki
import requests
import yaml
@ -48,6 +50,8 @@ def get_repo_owner(team_data, repo_name):
class Team(object):
_liaison_data = None
def __init__(self, name, data):
self.name = name
self.data = data
@ -68,6 +72,15 @@ class Team(object):
def tags(self):
return set(self.data.get('tags', []))
@property
def liaison(self):
if self._liaison_data is None:
# Only hit the wiki page one time.
Team._liaison_data = wiki.get_liaison_data()
team_liaison = self._liaison_data.get(self.name, {})
return (team_liaison.get('Liaison'),
team_liaison.get('IRC Handle'))
class Deliverable(object):
def __init__(self, name, data, team):