From 489af71a6b976e5aabf7fcc8b1919f812dadf1c7 Mon Sep 17 00:00:00 2001 From: Sam Morrison Date: Fri, 7 Jun 2019 10:10:09 +1000 Subject: Fix tenant floating_ip_allocation call in neutron rest api. The call to allocate a new floating IP was incorrecting calling tenant_floating_ip_allocate, this is used by neutron-lbaas-dashboard. Change-Id: Ia4d1367ccd309a074a0ea84a555d7de6c07971a6 Closes-bug: #1831954 (cherry picked from commit 92d832028df65cb95030b2a585764a62dc1c0b75) --- openstack_dashboard/api/rest/network.py | 2 +- openstack_dashboard/test/unit/api/rest/test_network.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openstack_dashboard/api/rest/network.py b/openstack_dashboard/api/rest/network.py index bf7872be4..8bdebb9c7 100644 --- a/openstack_dashboard/api/rest/network.py +++ b/openstack_dashboard/api/rest/network.py @@ -67,7 +67,7 @@ class FloatingIP(generic.View): if 'dns_name' in request.DATA: params['dns_name'] = request.DATA['dns_name'] result = api.neutron.tenant_floating_ip_allocate(request, pool, - None, params) + None, **params) return result.to_dict() @rest_utils.ajax(data_required=True) diff --git a/openstack_dashboard/test/unit/api/rest/test_network.py b/openstack_dashboard/test/unit/api/rest/test_network.py index 05d30f0ff..4b2b9f6b6 100644 --- a/openstack_dashboard/test/unit/api/rest/test_network.py +++ b/openstack_dashboard/test/unit/api/rest/test_network.py @@ -77,7 +77,7 @@ class RestNetworkApiFloatingIpTests(test.TestCase): self.mock_tenant_floating_ip_allocate.assert_called_once_with(request, 'pool', None, - {}) + **{}) @test.create_mocks({api.neutron: ['floating_ip_associate']}) def test_associate_floating_ip(self): -- cgit v1.2.1