fix latest release handling in branch validation

Not all repos that create stable branches will have tagged releases,
so only check the latest release when we need to.

Change-Id: Ieb51f8f280a6127ff0adc9432acfe65c809ac764
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2018-08-28 09:39:33 -04:00
parent 5b6ff05d48
commit b2bf0e0c4d

View File

@ -1365,8 +1365,6 @@ def validate_stable_branches(deliv, context):
branch_mode = deliv.stable_branch_type
latest_release = deliv.releases[-1]
known_series = sorted(list(
d for d in os.listdir('deliverables')
if not d.startswith('_')
@ -1414,6 +1412,8 @@ def validate_stable_branches(deliv, context):
print('{} branch already exists, skipping validation'.format(
branch.name))
continue
latest_release = deliv.releases[-1]
if location != latest_release.version:
context.error(
('stable branches must be created from the latest '