Allow kwargs in create_floating_ip
As a part of the scenario/manager.py stabilization tracked by
the below BP the patch adds kwargs argument for create_floating_ip
method so that the consumers are able to pass additional parameters
if needed.
Implements: blueprint tempest-scenario-manager-stable
Change-Id: Ia84a65621713d05564f9bf1107fb04f9a9b3314d
diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py
index ff860d5..74fbe73 100644
--- a/tempest/scenario/manager.py
+++ b/tempest/scenario/manager.py
@@ -1109,7 +1109,7 @@
return net[0]
def create_floating_ip(self, server, external_network_id=None,
- port_id=None, client=None):
+ port_id=None, client=None, **kwargs):
"""Create a floating IP and associates to a resource/port on Neutron"""
if not external_network_id:
@@ -1121,15 +1121,17 @@
else:
ip4 = None
- kwargs = {
+ floatingip_kwargs = {
'floating_network_id': external_network_id,
'port_id': port_id,
'tenant_id': server.get('project_id') or server['tenant_id'],
'fixed_ip_address': ip4,
}
if CONF.network.subnet_id:
- kwargs['subnet_id'] = CONF.network.subnet_id
- result = client.create_floatingip(**kwargs)
+ floatingip_kwargs['subnet_id'] = CONF.network.subnet_id
+
+ floatingip_kwargs.update(kwargs)
+ result = client.create_floatingip(**floatingip_kwargs)
floating_ip = result['floatingip']
self.addCleanup(test_utils.call_and_ignore_notfound_exc,