Replace the usage of 'manager' with 'os_primary'
In tempest, alias 'manager' has been moved to 'os_primary' in version Pike, and it will be removed in version Queens [1]. The other usages which also need to be replaced, are listed below: * admin_manager > os_admin [2] * os_adm > os_admin [3] * os > os_primary [4] [1] https://review.openstack.org/#/c/468036/ [2] https://review.openstack.org/#/c/467852/ [3] https://review.openstack.org/#/c/467605/ [4] https://review.openstack.org/#/c/466991/ Change-Id: I68e8ec2de665109d51502f3bc083f558ca25832c
This commit is contained in:
parent
3a067a0059
commit
d620ac702a
|
@ -31,7 +31,7 @@ class FWaaSClientMixin(object):
|
|||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(FWaaSClientMixin, cls).resource_setup()
|
||||
manager = cls.manager
|
||||
manager = cls.os_primary
|
||||
cls.firewalls_client = client.FirewallsClient(
|
||||
manager.auth_provider,
|
||||
CONF.network.catalog_type,
|
||||
|
|
|
@ -32,7 +32,7 @@ class FWaaSClientMixin(object):
|
|||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(FWaaSClientMixin, cls).resource_setup()
|
||||
manager = cls.manager
|
||||
manager = cls.os_primary
|
||||
cls.firewall_groups_client = v2_client.FirewallGroupsClient(
|
||||
manager.auth_provider,
|
||||
CONF.network.catalog_type,
|
||||
|
|
|
@ -47,45 +47,45 @@ class ScenarioTest(tempest.test.BaseTestCase):
|
|||
def setup_clients(cls):
|
||||
super(ScenarioTest, cls).setup_clients()
|
||||
# Clients (in alphabetical order)
|
||||
cls.flavors_client = cls.manager.flavors_client
|
||||
cls.flavors_client = cls.os_primary.flavors_client
|
||||
cls.compute_floating_ips_client = (
|
||||
cls.manager.compute_floating_ips_client)
|
||||
cls.os_primary.compute_floating_ips_client)
|
||||
if CONF.service_available.glance:
|
||||
# Check if glance v1 is available to determine which client to use.
|
||||
if CONF.image_feature_enabled.api_v1:
|
||||
cls.image_client = cls.manager.image_client
|
||||
cls.image_client = cls.os_primary.image_client
|
||||
elif CONF.image_feature_enabled.api_v2:
|
||||
cls.image_client = cls.manager.image_client_v2
|
||||
cls.image_client = cls.os_primary.image_client_v2
|
||||
else:
|
||||
raise lib_exc.InvalidConfiguration(
|
||||
'Either api_v1 or api_v2 must be True in '
|
||||
'[image-feature-enabled].')
|
||||
# Compute image client
|
||||
cls.compute_images_client = cls.manager.compute_images_client
|
||||
cls.keypairs_client = cls.manager.keypairs_client
|
||||
cls.compute_images_client = cls.os_primary.compute_images_client
|
||||
cls.keypairs_client = cls.os_primary.keypairs_client
|
||||
# Nova security groups client
|
||||
cls.compute_security_groups_client = (
|
||||
cls.manager.compute_security_groups_client)
|
||||
cls.os_primary.compute_security_groups_client)
|
||||
cls.compute_security_group_rules_client = (
|
||||
cls.manager.compute_security_group_rules_client)
|
||||
cls.servers_client = cls.manager.servers_client
|
||||
cls.interface_client = cls.manager.interfaces_client
|
||||
cls.os_primary.compute_security_group_rules_client)
|
||||
cls.servers_client = cls.os_primary.servers_client
|
||||
cls.interface_client = cls.os_primary.interfaces_client
|
||||
# Neutron network client
|
||||
cls.networks_client = cls.manager.networks_client
|
||||
cls.ports_client = cls.manager.ports_client
|
||||
cls.routers_client = cls.manager.routers_client
|
||||
cls.subnets_client = cls.manager.subnets_client
|
||||
cls.floating_ips_client = cls.manager.floating_ips_client
|
||||
cls.security_groups_client = cls.manager.security_groups_client
|
||||
cls.networks_client = cls.os_primary.networks_client
|
||||
cls.ports_client = cls.os_primary.ports_client
|
||||
cls.routers_client = cls.os_primary.routers_client
|
||||
cls.subnets_client = cls.os_primary.subnets_client
|
||||
cls.floating_ips_client = cls.os_primary.floating_ips_client
|
||||
cls.security_groups_client = cls.os_primary.security_groups_client
|
||||
cls.security_group_rules_client = (
|
||||
cls.manager.security_group_rules_client)
|
||||
cls.os_primary.security_group_rules_client)
|
||||
|
||||
if CONF.volume_feature_enabled.api_v2:
|
||||
cls.volumes_client = cls.manager.volumes_v2_client
|
||||
cls.snapshots_client = cls.manager.snapshots_v2_client
|
||||
cls.volumes_client = cls.os_primary.volumes_v2_client
|
||||
cls.snapshots_client = cls.os_primary.snapshots_v2_client
|
||||
else:
|
||||
cls.volumes_client = cls.manager.volumes_client
|
||||
cls.snapshots_client = cls.manager.snapshots_client
|
||||
cls.volumes_client = cls.os_primary.volumes_client
|
||||
cls.snapshots_client = cls.os_primary.snapshots_client
|
||||
|
||||
# ## Test functions library
|
||||
#
|
||||
|
@ -138,7 +138,7 @@ class ScenarioTest(tempest.test.BaseTestCase):
|
|||
|
||||
# Needed for the cross_tenant_traffic test:
|
||||
if clients is None:
|
||||
clients = self.manager
|
||||
clients = self.os_primary
|
||||
|
||||
if name is None:
|
||||
name = data_utils.rand_name(self.__class__.__name__ + "-server")
|
||||
|
@ -749,7 +749,7 @@ class NetworkScenarioTest(ScenarioTest):
|
|||
:returns: True if subnet with cidr already exist in tenant
|
||||
False else
|
||||
"""
|
||||
cidr_in_use = self.admin_manager.subnets_client.list_subnets(
|
||||
cidr_in_use = self.os_admin.subnets_client.list_subnets(
|
||||
tenant_id=tenant_id, cidr=cidr)['subnets']
|
||||
return len(cidr_in_use) != 0
|
||||
|
||||
|
@ -798,7 +798,7 @@ class NetworkScenarioTest(ScenarioTest):
|
|||
return subnet
|
||||
|
||||
def _get_server_port_id_and_ip4(self, server, ip_addr=None):
|
||||
ports = self.admin_manager.ports_client.list_ports(
|
||||
ports = self.os_admin.ports_client.list_ports(
|
||||
device_id=server['id'], fixed_ip=ip_addr)['ports']
|
||||
# A port can have more than one IP address in some cases.
|
||||
# If the network is dual-stack (IPv4 + IPv6), this port is associated
|
||||
|
@ -828,7 +828,7 @@ class NetworkScenarioTest(ScenarioTest):
|
|||
return port_map[0]
|
||||
|
||||
def _get_network_by_name(self, network_name):
|
||||
net = self.admin_manager.networks_client.list_networks(
|
||||
net = self.os_admin.networks_client.list_networks(
|
||||
name=network_name)['networks']
|
||||
self.assertNotEqual(len(net), 0,
|
||||
"Unable to get network by name: %s" % network_name)
|
||||
|
@ -1231,13 +1231,13 @@ class EncryptionScenarioTest(ScenarioTest):
|
|||
def setup_clients(cls):
|
||||
super(EncryptionScenarioTest, cls).setup_clients()
|
||||
if CONF.volume_feature_enabled.api_v2:
|
||||
cls.admin_volume_types_client = cls.os_adm.volume_types_v2_client
|
||||
cls.admin_volume_types_client = cls.os_admin.volume_types_v2_client
|
||||
cls.admin_encryption_types_client =\
|
||||
cls.os_adm.encryption_types_v2_client
|
||||
cls.os_admin.encryption_types_v2_client
|
||||
else:
|
||||
cls.admin_volume_types_client = cls.os_adm.volume_types_client
|
||||
cls.admin_volume_types_client = cls.os_admin.volume_types_client
|
||||
cls.admin_encryption_types_client =\
|
||||
cls.os_adm.encryption_types_client
|
||||
cls.os_admin.encryption_types_client
|
||||
|
||||
def create_encryption_type(self, client=None, type_id=None, provider=None,
|
||||
key_size=None, cipher=None,
|
||||
|
|
|
@ -278,7 +278,7 @@ class TestFWaaS(base.FWaaSScenarioTest):
|
|||
ext_fixed_ips = ext_gw_info['external_fixed_ips']
|
||||
for ip in ext_fixed_ips:
|
||||
subnet_id = ip['subnet_id']
|
||||
res = self.admin_manager.subnets_client.show_subnet(subnet_id)
|
||||
res = self.os_admin.subnets_client.show_subnet(subnet_id)
|
||||
subnet = res['subnet']
|
||||
# REVISIT(yamamoto): IPv4 assumption
|
||||
if subnet['ip_version'] == 4:
|
||||
|
|
|
@ -65,7 +65,7 @@ class TestFWaaS_v2(base.FWaaSScenarioTest_V2):
|
|||
def _check_connectivity_between_internal_networks(
|
||||
self, floating_ip1, keys1, network2, server2, should_connect=True):
|
||||
internal_ips = (p['fixed_ips'][0]['ip_address'] for p in
|
||||
self.admin_manager.ports_client.list_ports(
|
||||
self.os_admin.ports_client.list_ports(
|
||||
tenant_id=server2['tenant_id'],
|
||||
network_id=network2['id'])['ports']
|
||||
if p['device_owner'].startswith('network'))
|
||||
|
|
Loading…
Reference in New Issue