Adding 'ceph' and 'opstools' repos to validate tripleo_ci_testinig

Change [1] started affacting and making promotion blocker.
This patch fixes the issue.

[1] https://review.opendev.org/#/c/724193/54/roles/tripleo-repos/tasks/main.yml

Closes-Bug: #1883119
Change-Id: Ia563e2cf960403c6fdaaf5dbc6d1f058ece89aff
This commit is contained in:
Pooja Jadhav 2020-06-11 21:44:34 +05:30
parent 683b7870ec
commit ecf6206508
2 changed files with 9 additions and 3 deletions

View File

@ -241,14 +241,16 @@ def _validate_tripleo_ci_testing(repos):
"""Validate tripleo-ci-testing
With tripleo-ci-testing for repo (currently only periodic container build)
no other repos expected except optionally deps which is enabled regardless.
no other repos expected except optionally deps|ceph|opstools
which is enabled regardless.
"""
if 'tripleo-ci-testing' in repos and len(repos) > 1:
if 'deps' in repos and len(repos) == 2:
if 'deps' in repos or 'ceph' in repos or 'opstools' in repos:
return True
else:
raise InvalidArguments('Cannot use tripleo-ci-testing at the '
'same time as other repos, except deps.')
'same time as other repos, except '
'deps|ceph|opstools.')
return True

View File

@ -538,6 +538,10 @@ class TestValidate(testtools.TestCase):
self.assertRaises(main.InvalidArguments, main._validate_args,
self.args)
def test_tripleo_ci_testing_and_ceph_opstools_allowed(self):
self.args.repos = ['ceph', 'opstools', 'tripleo-ci-testing']
main._validate_args(self.args)
def test_tripleo_ci_testing_and_deps_allowed(self):
self.args.repos = ['deps', 'tripleo-ci-testing']
main._validate_args(self.args)