Merge "Don't use Tempest internal methods"

This commit is contained in:
Jenkins 2017-02-28 19:29:40 +00:00 committed by Gerrit Code Review
commit c8ecd1fa91
2 changed files with 12 additions and 6 deletions

View File

@ -118,12 +118,14 @@ class BaseTestCase(manager.NetworkScenarioTest):
""" """
tenant_id = self.load_balancers_client.tenant_id tenant_id = self.load_balancers_client.tenant_id
try: try:
tenant_net = self._list_networks(tenant_id=tenant_id)[0] tenant_net = self.admin_manager.networks_client.list_networks(
tenant_id=tenant_id)['networks'][0]
except IndexError: except IndexError:
tenant_net = None tenant_net = None
if tenant_net: if tenant_net:
tenant_subnet = self._list_subnets(tenant_id=tenant_id)[0] tenant_subnet = self.admin_manager.subnets_client.list_subnets(
tenant_id=tenant_id)['subnets'][0]
self.subnet = tenant_subnet self.subnet = tenant_subnet
self.network = tenant_net self.network = tenant_net
else: else:
@ -133,7 +135,8 @@ class BaseTestCase(manager.NetworkScenarioTest):
# with the fixed network is the one we want. In the future, we # 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 # should instead pull a subnet id from config, which is set by
# devstack/admin/etc. # 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 = subnet self.subnet = subnet
def _create_security_group_for_test(self): def _create_security_group_for_test(self):

View File

@ -115,12 +115,14 @@ class BaseTestCase(manager.NetworkScenarioTest):
fallback in absence of tenant networking. fallback in absence of tenant networking.
""" """
try: 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: except IndexError:
tenant_net = None tenant_net = None
if tenant_net: 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 = tenant_subnet self.subnet = tenant_subnet
self.network = tenant_net self.network = tenant_net
else: else:
@ -130,7 +132,8 @@ class BaseTestCase(manager.NetworkScenarioTest):
# with the fixed network is the one we want. In the future, we # 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 # should instead pull a subnet id from config, which is set by
# devstack/admin/etc. # 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 = subnet self.subnet = subnet
def _create_security_group_for_test(self): def _create_security_group_for_test(self):