Fix branch to series matching logic in job updates

Missed in Id58f439052b4ea6b092b87682576a746433dcc27 that the branch name
passed in when determining the next series name will be of the form
'stable/series', resulting in not finding the next name and job update
logic being skipped. This adjusts the branch name to properly match the
series name.

Change-Id: Ie4102ceb0d12b7d98919ddb89b8e17df1859fa6a
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit is contained in:
Sean McGinnis 2020-04-08 15:40:05 -05:00
parent 5e7bd5ba36
commit ebee7e0d7c
No known key found for this signature in database
GPG Key ID: CE7EE4BFAF8D70C8
1 changed files with 2 additions and 1 deletions

View File

@ -54,10 +54,11 @@ BRANCH_SCRIPT = os.path.join(BINDIR, 'make_branch.sh')
def nextbranchname(branchname, reporoot):
"""Returns a string containing the next development branchname."""
datafile = 'data/series_status.yaml'
branch_name = branchname.replace('stable/', '')
with open(os.path.join(reporoot, datafile), 'r') as seriesstatusf:
series = yaml.safe_load(seriesstatusf)
for nextseries, currentseries in zip(series, series[1:]):
if currentseries['name'] == branchname:
if currentseries['name'] == branch_name:
return nextseries['name']
return None