Update select_release_end_date() to work cross release
Currently the event name is limited to 'x-final', this doesn't work for current releases. Update that to determine the correct tag. Change-Id: I14a2d71a0bc26c837ebe4dfebbcfc9b05f02b069
This commit is contained in:
parent
d084748d44
commit
5701eea441
@ -97,10 +97,11 @@ def validate_tc_charter(election_type, release_schedule,
|
||||
exit(1)
|
||||
|
||||
|
||||
def select_release_end_date(release_schedule):
|
||||
def select_release_end_date(release_name, release_schedule):
|
||||
date = None
|
||||
event = '%s-final' % (release_name[0:1])
|
||||
for week in release_schedule.get('cycle', []):
|
||||
if 'x-final' in week.get('x-project', {}):
|
||||
if event in week.get('x-project', []):
|
||||
date = datetime.datetime.strptime(
|
||||
week['end'],
|
||||
"%Y-%m-%d").replace(tzinfo=pytz.UTC)
|
||||
@ -139,7 +140,7 @@ def main():
|
||||
# select the release end date.
|
||||
if (args.date is None):
|
||||
schedule = utils.get_schedule_data(names[idx+1])
|
||||
args.date = select_release_end_date(schedule)
|
||||
args.date = select_release_end_date(names[idx+1], schedule)
|
||||
if args.date is None:
|
||||
print("Error: no end date found in series data")
|
||||
exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user