[openstack-dev] [nova] nova hooks - document & test or deprecate?

Andrew Laski andrew at lascii.com
Mon Feb 29 18:49:23 UTC 2016



On Mon, Feb 29, 2016, at 01:18 PM, Dan Smith wrote:
> > Forgive my ignorance or for playing devil's advocate, but wouldn't the
> > main difference between notifications and hooks be that notifications
> > are asynchronous and hooks aren't?
> 
> The main difference is that notifications are external and intended to
> be stable (especially with the versioned notifications effort). The
> hooks are internal and depend wholly on internal data structures.
> 
> > In the case of how Rdo was using it,
> > they are adding things to the injected_files list before the instance is
> > created in the compute API.  You couldn't do that with notifications as
> > far as I know.
> 
> Nope, definitely not, but I see that as a good thing. Injecting files
> like that is likely to be very fragile and I think mostly regarded as
> substantially less desirable than the alternatives, regardless of how it
> happens.
> 
> I think that Laski's point was that the most useful and least dangerous
> thing that hooks can be used for is the use case that is much better
> served by notifications.

Yep. My experience with them was things like updating an external cache
on create/delete or calling out to a DNS provider to remove a reverse
DNS entry on instance delete. Things that could easily be handled with
notifications, and use cases that I think we should continue to support
by improving notifications if necessary.


> 
> So, if file injection (and any other internals-mangling that other
> people may use them for) is not a reason to keep hooks, and if
> notifications are the proper way to trigger on things happening, then
> there's no reason to keep hooks.
> 
> --Dan
> 
> __________________________________________________________________________
> 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



More information about the OpenStack-dev mailing list