]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
BSN: include missing data in floating IP call
authorKevin Benton <blak111@gmail.com>
Tue, 18 Nov 2014 09:42:34 +0000 (01:42 -0800)
committerKevin Benton <kevinbenton@buttewifi.com>
Fri, 21 Nov 2014 21:56:07 +0000 (21:56 +0000)
Includes some missing floating IP data in an optimized
floating IP API that was previously unused.

Closes-Bug: #1394030
Change-Id: Icba2f837dbc3838f86d125d261b5e2325000c618
(cherry picked from commit 55a031e624f347d346d1909afec75482950d123c)

neutron/plugins/bigswitch/servermanager.py
neutron/tests/unit/bigswitch/test_servermanager.py

index c10ce72bb510804c714a6e340ef9bb3b535e137d..992bfc7906f1d87e65eee663b049828126aa23d5 100644 (file)
@@ -578,12 +578,12 @@ class ServerPool(object):
     def rest_create_floatingip(self, tenant_id, floatingip):
         resource = FLOATINGIPS_PATH % (tenant_id, floatingip['id'])
         errstr = _("Unable to create floating IP: %s")
-        self.rest_action('PUT', resource, errstr=errstr)
+        self.rest_action('PUT', resource, floatingip, errstr=errstr)
 
     def rest_update_floatingip(self, tenant_id, floatingip, oldid):
         resource = FLOATINGIPS_PATH % (tenant_id, oldid)
         errstr = _("Unable to update floating IP: %s")
-        self.rest_action('PUT', resource, errstr=errstr)
+        self.rest_action('PUT', resource, floatingip, errstr=errstr)
 
     def rest_delete_floatingip(self, tenant_id, oldid):
         resource = FLOATINGIPS_PATH % (tenant_id, oldid)
index e8d15efa3b3bd87a6533acae4a733a13d38c9416..be60dbca0f06f5bca1735efa4312d78716ae650b 100644 (file)
@@ -445,13 +445,17 @@ class ServerManagerTests(test_rp.BigSwitchProxyPluginV2TestCase):
     def test_floating_calls(self):
         pl = manager.NeutronManager.get_plugin()
         with mock.patch(SERVERMANAGER + '.ServerPool.rest_action') as ramock:
-            pl.servers.rest_create_floatingip('tenant', {'id': 'somefloat'})
-            pl.servers.rest_update_floatingip('tenant', {'name': 'myfl'}, 'id')
+            body1 = {'id': 'somefloat'}
+            body2 = {'name': 'myfl'}
+            pl.servers.rest_create_floatingip('tenant', body1)
+            pl.servers.rest_update_floatingip('tenant', body2, 'id')
             pl.servers.rest_delete_floatingip('tenant', 'oldid')
             ramock.assert_has_calls([
                 mock.call('PUT', '/tenants/tenant/floatingips/somefloat',
+                          body1,
                           errstr=u'Unable to create floating IP: %s'),
                 mock.call('PUT', '/tenants/tenant/floatingips/id',
+                          body2,
                           errstr=u'Unable to update floating IP: %s'),
                 mock.call('DELETE', '/tenants/tenant/floatingips/oldid',
                           errstr=u'Unable to delete floating IP: %s')