diff --git a/config_tempest/clients.py b/config_tempest/clients.py index 934f4c7a..bdc4b755 100644 --- a/config_tempest/clients.py +++ b/config_tempest/clients.py @@ -16,7 +16,6 @@ from tempest.lib import exceptions from tempest.lib.services.compute import flavors_client from tempest.lib.services.compute import hosts_client -from tempest.lib.services.compute import networks_client as nova_net_client from tempest.lib.services.compute import servers_client from tempest.lib.services.identity.v2 import identity_client from tempest.lib.services.identity.v2 import roles_client @@ -158,12 +157,6 @@ class ClientManager(object): self.networks = None - def create_nova_network_client(): - if self.networks is None: - self.networks = nova_net_client.NetworksClient( - self.auth_provider, **compute_params) - return self.networks - def create_neutron_client(): if self.networks is None: self.networks = networks_client.NetworksClient( @@ -175,7 +168,6 @@ class ClientManager(object): **default_params) return self.networks - self.get_nova_net_client = create_nova_network_client self.get_neutron_client = create_neutron_client # Set admin project id needed for keystone v3 tests. diff --git a/config_tempest/main.py b/config_tempest/main.py index 08aebc91..d685e6f2 100755 --- a/config_tempest/main.py +++ b/config_tempest/main.py @@ -544,13 +544,9 @@ def config_tempest(**kwargs): False)) image.create_tempest_images(conf) - # FIXME(chkumar246): Remove dead code of nova_network - # as it is deprecated long time ago. - has_neutron = services.is_service(**{"type": "network"}) - if has_neutron: + if services.is_service(**{"type": "network"}): network = services.get_service("network") - network.create_tempest_networks(has_neutron, conf, - kwargs.get('network_id')) + network.create_tempest_networks(conf, kwargs.get('network_id')) services.post_configuration() services.set_supported_api_versions() diff --git a/config_tempest/services/network.py b/config_tempest/services/network.py index c086e4a7..4586e6d0 100644 --- a/config_tempest/services/network.py +++ b/config_tempest/services/network.py @@ -25,15 +25,10 @@ class NetworkService(VersionedService): body = json.loads(body) self.extensions = list(map(lambda x: x['alias'], body['extensions'])) - def create_tempest_networks(self, has_neutron, conf, network_id): + def create_tempest_networks(self, conf, network_id): LOG.info("Setting up network") - LOG.debug("Is neutron present: {0}".format(has_neutron)) - if has_neutron: - self.client = self.client.get_neutron_client() - self.create_tempest_networks_neutron(conf, network_id) - else: - self.client = self.client.get_nova_net_client() - self.create_tempest_networks_nova(conf) + self.client = self.client.get_neutron_client() + self.create_tempest_networks_neutron(conf, network_id) def create_tempest_networks_neutron(self, conf, public_network_id): self._public_network_name = None @@ -82,16 +77,6 @@ class NetworkService(VersionedService): "Please note that any test that relies on external " "connectivity would most likely fail.") - def create_tempest_networks_nova(self, conf): - networks = self.client.list_networks() - if networks: - label = networks['networks'][0]['label'] - if label: - conf.set('compute', 'fixed_network_name', label) - else: - raise Exception('fixed_network_name could not be ' - 'discovered and must be specified') - @staticmethod def get_service_type(): return ['network'] diff --git a/config_tempest/tests/services/test_network.py b/config_tempest/tests/services/test_network.py index 47ed22ff..9d32becb 100644 --- a/config_tempest/tests/services/test_network.py +++ b/config_tempest/tests/services/test_network.py @@ -82,21 +82,3 @@ class TestNetworkService(BaseServiceTest): self.Service._discover_network() # check if LOG.error was called self.assertTrue(mock_logging.error.called) - - def test_network_not_discovered(self): - FAKE_NETWORK_LIST = { - 'networks': [{ - 'label': "" - }] - } - exception = Exception - self.Service.client.return_value = FAKE_NETWORK_LIST - self.assertRaises(exception, - self.Service.create_tempest_networks_nova, - conf=self.conf) - - def test_create_fixed_network(self): - self.Service.client.return_value = self.FAKE_NETWORK_LIST - self.Service.create_tempest_networks_nova(conf=self.conf) - self.assertEqual(self.conf.get('compute', 'fixed_network_name'), - 'my_fake_label') diff --git a/releasenotes/notes/remove-nova-network-support-79e70a0590a638c9.yaml b/releasenotes/notes/remove-nova-network-support-79e70a0590a638c9.yaml new file mode 100644 index 00000000..72b08c01 --- /dev/null +++ b/releasenotes/notes/remove-nova-network-support-79e70a0590a638c9.yaml @@ -0,0 +1,6 @@ +--- +other: + - | + It removes the support of nova network. + It also removes the setting of following config in tempest.conf: + - compute.fixed_network_name