diff options
-rw-r--r-- | apex/builders/common_builder.py | 13 | ||||
-rw-r--r-- | apex/tests/test_apex_common_builder.py | 6 |
2 files changed, 10 insertions, 9 deletions
diff --git a/apex/builders/common_builder.py b/apex/builders/common_builder.py index e0e7303e..2934a1d8 100644 --- a/apex/builders/common_builder.py +++ b/apex/builders/common_builder.py @@ -265,14 +265,15 @@ def create_git_archive(repo_url, repo_name, tmp_dir, def get_neutron_driver(ds_opts): sdn = ds_opts.get('sdn_controller', None) - for controllers in 'opendaylight', 'ovn': - if sdn == controllers: - return sdn - if ds_opts.get('vpp', False): + if sdn == 'opendaylight': + return 'odl' + elif sdn == 'ovn': + return sdn + elif ds_opts.get('vpp', False): return 'vpp' - - return None + else: + return None def prepare_container_images(prep_file, branch='master', neutron_driver=None): diff --git a/apex/tests/test_apex_common_builder.py b/apex/tests/test_apex_common_builder.py index dede55a2..dc4383b9 100644 --- a/apex/tests/test_apex_common_builder.py +++ b/apex/tests/test_apex_common_builder.py @@ -259,7 +259,7 @@ class TestCommonBuilder(unittest.TestCase): 'vpn': False, 'sriov': False} self.assertEquals(c_builder.get_neutron_driver(ds_opts), - 'opendaylight') + 'odl') ds_opts['sdn_controller'] = None ds_opts['vpp'] = True self.assertEquals(c_builder.get_neutron_driver(ds_opts), @@ -288,7 +288,7 @@ class TestCommonBuilder(unittest.TestCase): 'ContainerImagePrepare': [ {'set': {'namespace': 'docker.io/tripleoqueens', - 'neutron_driver': 'opendaylight', + 'neutron_driver': 'odl', } } ] @@ -296,7 +296,7 @@ class TestCommonBuilder(unittest.TestCase): } c_builder.prepare_container_images('dummy.yaml', 'queens', - 'opendaylight') + 'odl') mock_yaml.safe_dump.assert_called_with( expected_output, a_mock_open.return_value, |