From 5aa9c9a874818e460c55a80982a759fb9c0eb4b9 Mon Sep 17 00:00:00 2001 From: Luke Short Date: Mon, 10 Feb 2020 14:21:56 -0500 Subject: [PATCH] Add missing current-tripleo-rdo repository choice. Change-Id: I23d93d203b458058282ea62e1476cc212cee2931 Signed-off-by: Luke Short --- tripleo_repos/main.py | 9 +++++++-- tripleo_repos/tests/test_main.py | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/tripleo_repos/main.py b/tripleo_repos/main.py index 5d350de..d45994d 100755 --- a/tripleo_repos/main.py +++ b/tripleo_repos/main.py @@ -139,7 +139,7 @@ def _parse_args(): parser.add_argument('repos', metavar='REPO', nargs='+', choices=['current', 'deps', 'current-tripleo', 'current-tripleo-dev', 'ceph', 'opstools', - 'tripleo-ci-testing'], + 'tripleo-ci-testing', 'current-tripleo-rdo'], help='A list of repos. Available repos: ' '%(choices)s. The deps repo will always be ' 'included when using current or ' @@ -210,7 +210,7 @@ def _validate_distro_repos(args): elif args.distro in ['centos7', 'centos8', 'rhel8']: valid_repos = ['ceph', 'current', 'current-tripleo', 'current-tripleo-dev', 'deps', 'tripleo-ci-testing', - 'opstools'] + 'opstools', 'current-tripleo-rdo'] invalid_repos = [x for x in args.repos if x not in valid_repos] if len(invalid_repos) > 0: raise InvalidArguments('{} repo(s) are not valid for {}. Valid repos ' @@ -369,6 +369,11 @@ def _install_repos(args, base_path): args) _write_repo(content, args.output_path) install_deps(args, base_path) + elif repo == 'current-tripleo-rdo': + content = _get_repo( + base_path + 'current-tripleo-rdo/delorean.repo', args) + _write_repo(content, args.output_path) + install_deps(args, base_path) elif repo == 'ceph': if args.branch in ['liberty', 'mitaka']: content = _create_ceph(args, 'hammer') diff --git a/tripleo_repos/tests/test_main.py b/tripleo_repos/tests/test_main.py index 0032603..a152609 100644 --- a/tripleo_repos/tests/test_main.py +++ b/tripleo_repos/tests/test_main.py @@ -268,6 +268,25 @@ class TestTripleORepos(testtools.TestCase): ], mock_write.mock_calls) + @mock.patch('tripleo_repos.main._get_repo') + @mock.patch('tripleo_repos.main._write_repo') + def test_install_repos_current_tripleo_rdo(self, mock_write, mock_get): + args = mock.Mock() + args.repos = ['current-tripleo-rdo'] + args.branch = 'master' + args.output_path = 'test' + mock_get.return_value = '[delorean]\nMr. Fusion' + main._install_repos(args, 'roads/') + self.assertEqual([mock.call('roads/current-tripleo-rdo/delorean.repo', + args), + mock.call('roads/delorean-deps.repo', args), + ], + mock_get.mock_calls) + self.assertEqual([mock.call('[delorean]\nMr. Fusion', 'test'), + mock.call('[delorean]\nMr. Fusion', 'test'), + ], + mock_write.mock_calls) + @ddt.data('liberty', 'mitaka', 'newton', 'ocata', 'pike', 'queens', 'rocky', 'stein', 'master') @mock.patch('tripleo_repos.main._write_repo')