Browse Source

Add missing current-tripleo-rdo repository choice.

Change-Id: I23d93d203b458058282ea62e1476cc212cee2931
Signed-off-by: Luke Short <ekultails@gmail.com>
tags/0.1.0
Luke Short 4 months ago
parent
commit
5aa9c9a874
2 changed files with 26 additions and 2 deletions
  1. +7
    -2
      tripleo_repos/main.py
  2. +19
    -0
      tripleo_repos/tests/test_main.py

+ 7
- 2
tripleo_repos/main.py View File

@@ -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')


+ 19
- 0
tripleo_repos/tests/test_main.py View File

@@ -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')


Loading…
Cancel
Save