Add appointment placeholders in governance updates

When no candidate is supplied for a PTL position, replace the PTL
entry for that project with a placeholder pending subsequent
governance changes in which the TC will set appointments.

Change-Id: I24ab692425f57d53669bc69094e72e744c868a25
This commit is contained in:
Jeremy Stanley 2019-09-05 20:24:24 +00:00
parent c48852e3bb
commit e57d8da921

View File

@ -70,9 +70,19 @@ def update_projects(projects_fname, candidates_list, projects):
if match:
project_count += 1
p = utils.name2dir(match.group(1))
candidates = candidates_list['candidates'][p]
try:
candidates = candidates_list['candidates'][p]
except KeyError:
# Add placeholder for required TC appointment in cases
# where there is no candidate
candidates = [{
'fullname': 'APPOINTMENT NEEDED',
'ircname': 'No nick supplied',
'email': 'example@example.org',
}]
print('TC to appoint PTL for %s' % (p))
nr_candidates = len(candidates)
# Only update the PTL if there is a sinble candidate
# Only update the PTL if there is a single candidate
if nr_candidates == 1:
line += ((' ptl:\n' +
' name: %(fullname)s\n' +
@ -83,9 +93,6 @@ def update_projects(projects_fname, candidates_list, projects):
# just written out new record so skip the next 4 lines in
# the projects file.
skip = 4
# Projects with no candidates need to be appointed by the TC
elif nr_candidates == 0:
print('Skipping %s TC to appiont' % (p))
else:
print('Skipping %s election in progress %d candidates' %
(p, nr_candidates))