use payloads for SECURITY_GROUP BEFORE_DELETE events

This patch switches over to the payload style callbacks for
BEFORE_DELETE events of SECURITY_GROUP resources.

NeutronLibImpact

Change-Id: I44ab8bfd92ece7501793979f8f45eae65f1e7a2c
This commit is contained in:
Boden R
2018-08-29 10:59:49 -06:00
parent f3810d0da3
commit 9a8f82a0d0

View File

@@ -216,7 +216,8 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase):
self._registry_notify(resources.SECURITY_GROUP,
events.BEFORE_DELETE,
exc_cls=ext_sg.SecurityGroupInUse, id=id,
**kwargs)
payload=events.DBEventPayload(
context, states=(sg,), resource_id=id))
with db_api.CONTEXT_WRITER.using(context):
# pass security_group_rule_ids to ensure