Redirects to master should always be temporary
We *know* that requirements will have a stable/train branch soon; make sure clients don't go caching the redirect to master. Change-Id: I8507d86e4f553b698163be61665267d42e033d91 Related-Change: Ia2e8c46c27ac97217576afdd1677efba4b99fc37
This commit is contained in:
parent
79b8f22b7e
commit
e392f0bd48
@ -41,7 +41,8 @@ def generate_constraints_redirections(_deliverables, future_releases=[]):
|
||||
|
||||
# Insert into the begining of the list so that redirections are
|
||||
# master -> juno
|
||||
redirections.insert(0, dict(code=301, src=deliv.series,
|
||||
status = 302 if target == 'master' else 301
|
||||
redirections.insert(0, dict(code=status, src=deliv.series,
|
||||
ref_type=ref_type, dst=target))
|
||||
|
||||
for series in future_releases:
|
||||
|
@ -122,7 +122,7 @@ class TestRedirections(base.BaseTestCase):
|
||||
deliverables = FakeDeliverables([
|
||||
self.OPEN_DEVELOPMENT,
|
||||
])
|
||||
self.assertEqual([dict(code=301, src='stein', ref_type='branch',
|
||||
self.assertEqual([dict(code=302, src='stein', ref_type='branch',
|
||||
dst='master')],
|
||||
generate_constraints_redirections(deliverables))
|
||||
|
||||
@ -130,7 +130,7 @@ class TestRedirections(base.BaseTestCase):
|
||||
deliverables = FakeDeliverables([
|
||||
self.DEVELOPMENT_RELEASE,
|
||||
])
|
||||
self.assertEqual([dict(code=301, src='stein', ref_type='branch',
|
||||
self.assertEqual([dict(code=302, src='stein', ref_type='branch',
|
||||
dst='master')],
|
||||
generate_constraints_redirections(deliverables))
|
||||
|
||||
@ -172,7 +172,7 @@ class TestRedirections(base.BaseTestCase):
|
||||
self.STABLE_RELEASE,
|
||||
self.DEVELOPMENT_RELEASE,
|
||||
])
|
||||
self.assertEqual([dict(code=301, src='stein', ref_type='branch',
|
||||
self.assertEqual([dict(code=302, src='stein', ref_type='branch',
|
||||
dst='master'),
|
||||
dict(code=301, src='rocky', ref_type='branch',
|
||||
dst='stable/rocky'),
|
||||
|
Loading…
Reference in New Issue
Block a user