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
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index 3adaa1e..1aaf8ce 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -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 @@
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 @@
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)
diff --git a/releasenotes/notes/mark-methods-removals-f8b230171c045a3e.yaml b/releasenotes/notes/mark-methods-removals-f8b230171c045a3e.yaml
new file mode 100644
index 0000000..ab9f37a
--- /dev/null
+++ b/releasenotes/notes/mark-methods-removals-f8b230171c045a3e.yaml
@@ -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.
diff --git a/requirements.txt b/requirements.txt
index 5660c68..e48daf7 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -16,3 +16,4 @@
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