[openstack-dev] [neutron] How to catch security group updates in ML2 mechanism driver?

Gal Sagie gal.sagie at gmail.com
Mon Jun 29 13:08:16 UTC 2015


Yes, look at this patch: https://review.openstack.org/#/c/174588/


On Mon, Jun 29, 2015 at 3:42 PM, Neil Jerram <Neil.Jerram at metaswitch.com>
wrote:

> Hi there,
>
> For my team's networking backend, we want to catch security group updates
> in our ML2 mechanism driver code.
>
> Currently we're doing this by monkey patching the AgentNotifierApi:
>
>     # This section monkeypatches the
> AgentNotifierApi.security_groups_rule_updated
>     # method to ensure that the Calico driver gets told about security
> group
>     # updates at all times. This is a deeply unpleasant hack. Please, do
> as I say,
>     # not as I do.
>     #
>     # For more info, please see issues #635 and #641.
>     original_sgr_updated =
> rpc.AgentNotifierApi.security_groups_rule_updated
>
>
>     def security_groups_rule_updated(self, context, sgids):
>         LOG.info("security_groups_rule_updated: %s %s" % (context, sgids))
>         mech_driver.send_sg_updates(sgids, context)
>         original_sgr_updated(self, context, sgids)
>
>
>     rpc.AgentNotifierApi.security_groups_rule_updated = (
>         security_groups_rule_updated
>     )
>
> But, as the comment says, this is a hack.  Is there a better way?
>
> Many thanks,
>         Neil
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



-- 
Best Regards ,

The G.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150629/121cb11a/attachment.html>


More information about the OpenStack-dev mailing list