← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1668262] Re: update callback subscriptions of object methods to use decorator

 

** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1668262

Title:
  update callback subscriptions of object methods to use decorator

Status in neutron:
  Fix Released

Bug description:
  We can now use @registry.receives("resource", ["event1", "event2"]) to
  decorate methods in a class that should be subscribed to the callback
  manager when its instances are created.

  This improves readability for two purposes:

  1. Using the decorator right above the method makes it easy to see when looking at the code when the method is going to be called instead of having to search for the component that subscribes it.
  2. We can stop overriding __new__ in class definitions just for registry subscriptions, which makes the class definitions a little cleaner.

  See https://review.openstack.org/#/c/438489/ and
  https://review.openstack.org/#/c/436353/ for examples.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1668262/+subscriptions



References