Notify ROUTER_GATEWAY event for router gw mode

Router gateway mode extension updating should notify the event
of ROUTER_GATEWAY, otherwise the event cannot be handled accurately.
Using ROUTER event, the event receiver will add a lot of check
conditions to confirm whether the GW has changed or the other
properties of router have changed.

Trivial fix.

Change-Id: I4dd35c9f0b0527e1a972cbade4388ffa6699930d
This commit is contained in:
LIU Yulong 2021-06-30 10:45:05 +08:00
parent 1789ca0d3d
commit 6d570dfd7d
1 changed files with 2 additions and 1 deletions

View File

@ -64,7 +64,8 @@ class L3_NAT_dbonly_mixin(l3_db.L3_NAT_dbonly_mixin):
router.enable_snat = self._get_enable_snat(info)
router_body = {l3_apidef.ROUTER:
{l3_apidef.EXTERNAL_GW_INFO: info}}
registry.publish(resources.ROUTER, events.PRECOMMIT_UPDATE, self,
registry.publish(resources.ROUTER_GATEWAY,
events.PRECOMMIT_UPDATE, self,
payload=events.DBEventPayload(
context, request_body=router_body,
states=(old_router,), resource_id=router_id,