From 8d47cdb375b5fa52bea98823bc417100890ffb62 Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Fri, 24 Feb 2017 16:06:41 -0800 Subject: [PATCH] Don't use Tempest internal methods All changed methods are clearly internal methods of Tempest, and the Tempest commit 64e6b4457c748f74bfb4fbf3860ab65b65ae9beb has removed the internal methods and now the gate issue happens. This patch makes this project to use better ones instead. Conflicts: neutron_lbaas/tests/tempest/v2/scenario/base.py Change-Id: I5d41652a85cfb91646bb48d38eedbe97741a97c2 Related-Bug: #1667824 (cherry picked from commit 18db6d460cd45f92c19f1225823f83aaaa4e8a7f) --- neutron_lbaas/tests/tempest/v2/scenario/base.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/neutron_lbaas/tests/tempest/v2/scenario/base.py b/neutron_lbaas/tests/tempest/v2/scenario/base.py index a4edfd049..5c8c8b550 100644 --- a/neutron_lbaas/tests/tempest/v2/scenario/base.py +++ b/neutron_lbaas/tests/tempest/v2/scenario/base.py @@ -119,12 +119,14 @@ class BaseTestCase(manager.NetworkScenarioTest): fallback in absence of tenant networking. """ try: - tenant_net = self._list_networks(tenant_id=self.tenant_id)[0] + tenant_net = self.admin_manager.networks_client.list_networks( + tenant_id=self.tenant_id)['networks'][0] except IndexError: tenant_net = None if tenant_net: - tenant_subnet = self._list_subnets(tenant_id=self.tenant_id)[0] + tenant_subnet = self.admin_manager.subnets_client.list_subnets( + tenant_id=self.tenant_id)['subnets'][0] self.subnet = net_resources.DeletableSubnet( subnets_client=self.subnets_client, routers_client=self.routers_client, @@ -137,7 +139,8 @@ class BaseTestCase(manager.NetworkScenarioTest): # with the fixed network is the one we want. In the future, we # should instead pull a subnet id from config, which is set by # devstack/admin/etc. - subnet = self._list_subnets(network_id=self.network['id'])[0] + subnet = self.admin_manager.subnets_client.list_subnets( + network_id=self.network['id'])['subnets'][0] self.subnet = net_resources.AttributeDict(subnet) def _create_security_group_for_test(self):