Merge "VMWare: don't notify on disassociate_floatingips()"
This commit is contained in:
commit
e7daa810d2
@ -1965,7 +1965,11 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
|||||||
except n_exc.NotFound:
|
except n_exc.NotFound:
|
||||||
LOG.warning(_("Nat rules not found in nsx for port: %s"), id)
|
LOG.warning(_("Nat rules not found in nsx for port: %s"), id)
|
||||||
|
|
||||||
super(NsxPluginV2, self).disassociate_floatingips(context, port_id)
|
# NOTE(ihrachys): L3 agent notifications don't make sense for
|
||||||
|
# NSX VMWare plugin since there is no L3 agent in such setup, so
|
||||||
|
# disabling them here.
|
||||||
|
super(NsxPluginV2, self).disassociate_floatingips(
|
||||||
|
context, port_id, do_notify=False)
|
||||||
|
|
||||||
def create_network_gateway(self, context, network_gateway):
|
def create_network_gateway(self, context, network_gateway):
|
||||||
"""Create a layer-2 network gateway.
|
"""Create a layer-2 network gateway.
|
||||||
|
@ -960,23 +960,28 @@ class TestL3NatTestCase(L3NatTest,
|
|||||||
with self.port() as p:
|
with self.port() as p:
|
||||||
private_sub = {'subnet': {'id':
|
private_sub = {'subnet': {'id':
|
||||||
p['port']['fixed_ips'][0]['subnet_id']}}
|
p['port']['fixed_ips'][0]['subnet_id']}}
|
||||||
with self.floatingip_no_assoc(private_sub) as fip:
|
plugin = manager.NeutronManager.get_plugin()
|
||||||
port_id = p['port']['id']
|
with mock.patch.object(plugin, 'notify_routers_updated') as notify:
|
||||||
body = self._update('floatingips', fip['floatingip']['id'],
|
with self.floatingip_no_assoc(private_sub) as fip:
|
||||||
{'floatingip': {'port_id': port_id}})
|
port_id = p['port']['id']
|
||||||
self.assertEqual(body['floatingip']['port_id'], port_id)
|
body = self._update('floatingips', fip['floatingip']['id'],
|
||||||
# Floating IP status should be active
|
{'floatingip': {'port_id': port_id}})
|
||||||
self.assertEqual(constants.FLOATINGIP_STATUS_ACTIVE,
|
self.assertEqual(body['floatingip']['port_id'], port_id)
|
||||||
body['floatingip']['status'])
|
# Floating IP status should be active
|
||||||
# Disassociate
|
self.assertEqual(constants.FLOATINGIP_STATUS_ACTIVE,
|
||||||
body = self._update('floatingips', fip['floatingip']['id'],
|
body['floatingip']['status'])
|
||||||
{'floatingip': {'port_id': None}})
|
# Disassociate
|
||||||
body = self._show('floatingips', fip['floatingip']['id'])
|
body = self._update('floatingips', fip['floatingip']['id'],
|
||||||
self.assertIsNone(body['floatingip']['port_id'])
|
{'floatingip': {'port_id': None}})
|
||||||
self.assertIsNone(body['floatingip']['fixed_ip_address'])
|
body = self._show('floatingips', fip['floatingip']['id'])
|
||||||
# Floating IP status should be down
|
self.assertIsNone(body['floatingip']['port_id'])
|
||||||
self.assertEqual(constants.FLOATINGIP_STATUS_DOWN,
|
self.assertIsNone(body['floatingip']['fixed_ip_address'])
|
||||||
body['floatingip']['status'])
|
# Floating IP status should be down
|
||||||
|
self.assertEqual(constants.FLOATINGIP_STATUS_DOWN,
|
||||||
|
body['floatingip']['status'])
|
||||||
|
|
||||||
|
# check that notification was not requested
|
||||||
|
self.assertFalse(notify.called)
|
||||||
|
|
||||||
def test_create_router_maintenance_returns_503(self):
|
def test_create_router_maintenance_returns_503(self):
|
||||||
with self._create_l3_ext_network() as net:
|
with self._create_l3_ext_network() as net:
|
||||||
|
Loading…
Reference in New Issue
Block a user