diff --git a/tripleo_repos/main.py b/tripleo_repos/main.py index ecaedba..1ed8ef4 100755 --- a/tripleo_repos/main.py +++ b/tripleo_repos/main.py @@ -228,8 +228,9 @@ def _remove_existing(args): def _get_base_path(args): if args.branch != 'master': - if args.distro not in ['centos7']: - raise InvalidArguments('Branches only suppported with centos7') + if args.distro in ['fedora28'] and args.branch != 'stein': + raise InvalidArguments('Only stable/stein branch is suppported ' + 'with fedora28.') distro_branch = '%s-%s' % (args.distro, args.branch) else: distro_branch = args.distro diff --git a/tripleo_repos/tests/test_main.py b/tripleo_repos/tests/test_main.py index 8ea7df4..161bcbf 100644 --- a/tripleo_repos/tests/test_main.py +++ b/tripleo_repos/tests/test_main.py @@ -130,12 +130,20 @@ class TestTripleORepos(testtools.TestCase): path = main._get_base_path(args) self.assertEqual('http://trunk.rdoproject.org/fedora/', path) - def test_get_base_path_fedora_branch(self): + def test_get_base_path_fedora_unsup_branch(self): args = mock.Mock() args.branch = 'rocky' - args.distro = 'fedora' + args.distro = 'fedora28' self.assertRaises(main.InvalidArguments, main._get_base_path, args) + def test_get_base_path_fedora_sup_branch(self): + args = mock.Mock() + args.branch = 'stein' + args.distro = 'fedora28' + args.rdo_mirror = 'http://trunk.rdoproject.org' + path = main._get_base_path(args) + self.assertEqual('http://trunk.rdoproject.org/fedora28-stein/', path) + @mock.patch('subprocess.check_call') def test_install_priorities(self, mock_check_call): main._install_priorities()