Use SUBNET instead of SUBNET_GATEWAY event in L3

SUBNET_GATEWAY is being superceded by SUBNET, so
we can just use that instead.

Change-Id: I3ef5e6a046df4bae28aa111a796210a59df820fa
Partial-Bug: #1690944
This commit is contained in:
Kevin Benton 2017-05-15 16:02:44 -07:00
parent b23959b998
commit 8f2aad8fe1
2 changed files with 8 additions and 4 deletions

View File

@ -1746,14 +1746,18 @@ class L3RpcNotifierMixin(object):
LOG.debug('%s not configured', constants.L3)
@staticmethod
@registry.receives(resources.SUBNET_GATEWAY, [events.AFTER_UPDATE])
@registry.receives(resources.SUBNET, [events.AFTER_UPDATE])
def _notify_subnet_gateway_ip_update(resource, event, trigger, **kwargs):
l3plugin = directory.get_plugin(constants.L3)
if not l3plugin:
return
context = kwargs['context']
network_id = kwargs['network_id']
subnet_id = kwargs['subnet_id']
orig = kwargs['original_subnet']
updated = kwargs['subnet']
if orig['gateway_ip'] == updated['gateway_ip']:
return
network_id = updated['network_id']
subnet_id = updated['id']
query = context.session.query(models_v2.Port).filter_by(
network_id=network_id,
device_owner=constants.DEVICE_OWNER_ROUTER_GW)

View File

@ -3253,7 +3253,7 @@ class L3NatTestCaseBase(L3NatTestCaseMixin):
# make sure the callback is registered.
registry.subscribe(
l3_db.L3RpcNotifierMixin._notify_subnet_gateway_ip_update,
resources.SUBNET_GATEWAY,
resources.SUBNET,
events.AFTER_UPDATE)
with mock.patch.object(plugin.l3_rpc_notifier,
'routers_updated') as chk_method: