Fix some tempest deprecation warnings
Saw this recently in a tempest test run:
DeprecationWarning: Read-only property 'manager'
has moved to 'os_primary' in version 'Pike' and
will be removed in version 'Queens'
Tempest BaseTestCase class credential names have changed
from manager->os_primary, admin->os_admin, and
alt_manager->os_alt, so we should start using them.
Closes-bug: #1697588
Change-Id: I44de8046fc983bf6780c310e8db174a5902c2826
diff --git a/neutron/tests/tempest/scenario/base.py b/neutron/tests/tempest/scenario/base.py
index 1e20c74..15a722a 100644
--- a/neutron/tests/tempest/scenario/base.py
+++ b/neutron/tests/tempest/scenario/base.py
@@ -71,7 +71,7 @@
if not security_groups:
security_groups = [{'name': 'default'}]
- server = self.manager.servers_client.create_server(
+ server = self.os_primary.servers_client.create_server(
name=name,
flavorRef=flavor_ref,
imageRef=image_ref,
@@ -81,9 +81,9 @@
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
waiters.wait_for_server_termination,
- self.manager.servers_client, server['server']['id'])
+ self.os_primary.servers_client, server['server']['id'])
self.addCleanup(test_utils.call_and_ignore_notfound_exc,
- self.manager.servers_client.delete_server,
+ self.os_primary.servers_client.delete_server,
server['server']['id'])
return server
@@ -155,7 +155,7 @@
return router
def create_and_associate_floatingip(self, port_id):
- fip = self.manager.network_client.create_floatingip(
+ fip = self.os_primary.network_client.create_floatingip(
CONF.network.public_network_id,
port_id=port_id)['floatingip']
self.floating_ips.append(fip)
@@ -172,7 +172,7 @@
self.subnet = self.create_subnet(self.network)
LOG.debug("Created subnet %s", self.subnet['id'])
- secgroup = self.manager.network_client.create_security_group(
+ secgroup = self.os_primary.network_client.create_security_group(
name=data_utils.rand_name('secgroup-'))
LOG.debug("Created security group %s",
secgroup['security_group']['name'])
@@ -189,7 +189,7 @@
key_name=self.keypair['name'],
networks=[{'uuid': self.network['id']}],
security_groups=[{'name': secgroup['security_group']['name']}])
- waiters.wait_for_server_status(self.manager.servers_client,
+ waiters.wait_for_server_status(self.os_primary.servers_client,
self.server['server']['id'],
constants.SERVER_STATUS_ACTIVE)
port = self.client.list_ports(network_id=self.network['id'],
@@ -211,12 +211,12 @@
LOG.debug('Console output not supported, cannot log')
return
if not servers:
- servers = self.manager.servers_client.list_servers()
+ servers = self.os_primary.servers_client.list_servers()
servers = servers['servers']
for server in servers:
try:
console_output = (
- self.manager.servers_client.get_console_output(
+ self.os_primary.servers_client.get_console_output(
server['id'])['output'])
LOG.debug('Console output for %s\nbody=\n%s',
server['id'], console_output)