Deprecate BaseTempestTestCase.create_and_associate_floatingip method

Add new 'debtcollector' dependency with the purpose of deprecating methods
that are going to be removed.

Mark BaseTempestTestCase.create_and_associate_floatingip for removal.

Replace create_and_associate_floatingip with create_floatingip in
BaseTempestTestCase class.

Change-Id: I5c5fd143a5cb4e138c46d13445f8225444bd2f58
This commit is contained in:
Federico Ressi 2018-08-22 08:36:37 +02:00
parent a69dcd5aec
commit bf877c84b3
3 changed files with 18 additions and 7 deletions

View File

@ -14,6 +14,7 @@
# under the License.
import subprocess
from debtcollector import removals
import netaddr
from neutron_lib.api import validators
from neutron_lib import constants as neutron_lib_constants
@ -158,14 +159,12 @@ class BaseTempestTestCase(base_api.BaseNetworkTest):
cls.routers.append(router)
return router
@removals.remove(version='Stein',
message="Please use create_floatingip method instead of "
"create_and_associate_floatingip.")
def create_and_associate_floatingip(self, port_id, client=None):
client = client or self.os_primary.network_client
fip = client.create_floatingip(
CONF.network.public_network_id,
port_id=port_id)['floatingip']
if client is self.os_primary.network_client:
self.floating_ips.append(fip)
return fip
return self.create_floatingip(port_id=port_id, client=client)
def create_interface(cls, server_id, port_id, client=None):
client = client or cls.os_primary.interfaces_client
@ -215,7 +214,7 @@ class BaseTempestTestCase(base_api.BaseNetworkTest):
self.port = self.client.list_ports(network_id=self.network['id'],
device_id=self.server[
'server']['id'])['ports'][0]
self.fip = self.create_and_associate_floatingip(self.port['id'])
self.fip = self.create_floatingip(port=self.port)
def check_connectivity(self, host, ssh_user, ssh_key, servers=None):
ssh_client = ssh.Client(host, ssh_user, pkey=ssh_key)

View File

@ -0,0 +1,11 @@
---
features:
- |
Add new 'debtcollector' dependency with the purpose of deprecating methods
that are going to be removed.
deprecations:
- |
Deprecate method BaseTempestTestCase.create_and_associate_floatingip after
replacing it with method BaseNetworkTest.create_floatingip.

View File

@ -16,3 +16,4 @@ ddt>=1.0.1 # MIT
testtools>=2.2.0 # MIT
testscenarios>=0.4 # Apache-2.0/BSD
eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT
debtcollector>=1.2.0 # Apache-2.0