update callback subscriptions of object methods to use decorator

Bug #1668262 reported by Kevin Benton
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Low
Kevin Benton

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.

Changed in neutron:
status: New → Confirmed
importance: Undecided → Low
tags: added: low-hanging-fruit
Changed in neutron:
assignee: nobody → Cedric Brandily (cbrandily)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/438718

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/438721

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/438724

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/439062

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/439076

Changed in neutron:
assignee: Cedric Brandily (cbrandily) → Kevin Benton (kevinbenton)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/438721
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=f448fd2229a5e6cdc92dd215b8e499e85984511f
Submitter: Jenkins
Branch: master

commit f448fd2229a5e6cdc92dd215b8e499e85984511f
Author: Cedric Brandily <email address hidden>
Date: Mon Feb 27 23:19:41 2017 +0100

    Use registry.receives decorator in neutron.db.l3_hamode_db

    Switch to registry.receives decorator in neutron.db.l3_hamode_db

    Partial-Bug: #1668262
    Change-Id: I57b9f268b2d26f9605452d57622d2c222625e2d2

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/439738

Changed in neutron:
assignee: Kevin Benton (kevinbenton) → Cedric Brandily (cbrandily)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/439741

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/439745

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/439750

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/439918

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/438724
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e1edf6f276736db9f2f8607d63ce68a761678ddd
Submitter: Jenkins
Branch: master

commit e1edf6f276736db9f2f8607d63ce68a761678ddd
Author: Cedric Brandily <email address hidden>
Date: Mon Feb 27 23:26:57 2017 +0100

    Use registry.receives decorator in neutron.db.availability_zone.router

    Switch to registry.receives decorator in neutron.db.availability_zone.router

    Partial-Bug: #1668262
    Change-Id: Ib4e34159bf71a749eddf945fb942f679da7bacd0

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/439745
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=4f237819cf20e83e738fbe5f66f9d87d8932cfd0
Submitter: Jenkins
Branch: master

commit 4f237819cf20e83e738fbe5f66f9d87d8932cfd0
Author: Cedric Brandily <email address hidden>
Date: Tue Feb 28 18:45:56 2017 +0100

    Use @registry.receives in neutron.services.qos.drivers.base

    Switch to registry.receives decorator in neutron.services.qos.drivers.base

    Change-Id: If7532e0f08824523b55f0de53a59525d519ca7f9
    Partial-Bug: #1668262

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/439741
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=2f4a5f8f37286b09d74ed18f562d09b37095a448
Submitter: Jenkins
Branch: master

commit 2f4a5f8f37286b09d74ed18f562d09b37095a448
Author: Cedric Brandily <email address hidden>
Date: Wed Mar 1 18:43:06 2017 +0100

    Use registry.receives decorator in driver_controller

    Switch to registry.receives decorator in
    neutron.services.l3_router.service_providers.driver_controller.

    Change-Id: I96b32365ef15c5e7c1f54cf58f1451e978f6bd91
    Partial-Bug: #1668262

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/438718
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=374de0ad49986b2f80a0bf3e16d16c48c3f8f7c0
Submitter: Jenkins
Branch: master

commit 374de0ad49986b2f80a0bf3e16d16c48c3f8f7c0
Author: Cedric Brandily <email address hidden>
Date: Mon Feb 27 23:08:24 2017 +0100

    Use registry.receives decorator in neutron.db.l3_dvr_db

    Switch to registry.receives decorator in neutron.db.l3_dvr_db

    Partial-Bug: #1668262
    Change-Id: I01b0711e5a4f4729ce76519522271577516cacec

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/439076
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e3cd8e9bdf7f5571517e87bb9d681e9a234c682c
Submitter: Jenkins
Branch: master

commit e3cd8e9bdf7f5571517e87bb9d681e9a234c682c
Author: Cedric Brandily <email address hidden>
Date: Tue Feb 28 18:45:56 2017 +0100

    Use registry.receives decorator in neutron.db.dvr_mac_db

    Switch to registry.receives decorator in neutron.db.dvr_mac_db.

    Change-Id: I7f1426adabe1d97b8df11d561454972354c23b14
    Partial-Bug: #1668262

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/442354

Changed in neutron:
assignee: Cedric Brandily (cbrandily) → Ihar Hrachyshka (ihar-hrachyshka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/439918
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=20097d44bf686c74c3dea236b730af51162f9408
Submitter: Jenkins
Branch: master

commit 20097d44bf686c74c3dea236b730af51162f9408
Author: Cedric Brandily <email address hidden>
Date: Tue Feb 28 18:45:56 2017 +0100

    Use @registry.receives in neutron.services.trunk

    Switch to registry.receives decorator in neutron.services.trunk package.

    Partial-Bug: #1668262
    Change-Id: Iad3d99d958eb906b1cf2370378149ba1a4b209f4

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/439738
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=a5e04fbd84b96e306db3d3ed6140fa82e7441495
Submitter: Jenkins
Branch: master

commit a5e04fbd84b96e306db3d3ed6140fa82e7441495
Author: Cedric Brandily <email address hidden>
Date: Wed Mar 1 18:33:57 2017 +0100

    Use registry.receives decorator in neutron.notifiers.nova

    Switch to registry.receives decorator in neutron.notifiers.nova.

    Partial-Bug: #1668262
    Change-Id: I50f61f97ded73cd3b7f18ac97d8d4b918554e098

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/439750
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=e4495bfe0a4fe97c206d279cd7fb49460e1254b8
Submitter: Jenkins
Branch: master

commit e4495bfe0a4fe97c206d279cd7fb49460e1254b8
Author: Cedric Brandily <email address hidden>
Date: Tue Feb 28 18:45:56 2017 +0100

    Use @registry.receives in neutron.services.segments.plugin

    Switch to registry.receives decorator in neutron.services.segments.plugin.

    Change-Id: Ic9b5a2ce2b1dac2ed912a72c9698d19c2cf4ce9d
    Partial-Bug: #1668262

Changed in neutron:
assignee: Ihar Hrachyshka (ihar-hrachyshka) → Kevin Benton (kevinbenton)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/439062
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=cd39505f89ccbd8ca22cfbd3f8fd6ccaffab186f
Submitter: Jenkins
Branch: master

commit cd39505f89ccbd8ca22cfbd3f8fd6ccaffab186f
Author: Cedric Brandily <email address hidden>
Date: Tue Feb 28 18:05:16 2017 +0100

    Use registry.receives decorator in neutron.db.db_base_plugin_v2

    Switch to registry.receives decorator in neutron.db.db_base_plugin_v2

    Partial-Bug: #1668262
    Change-Id: I205bac32d94bc40b737f7b2e90f559925821110a

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/442354
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=67f39774546d3edddbccfa226a823a8a292f5a2d
Submitter: Jenkins
Branch: master

commit 67f39774546d3edddbccfa226a823a8a292f5a2d
Author: Cedric Brandily <email address hidden>
Date: Tue Feb 28 18:45:56 2017 +0100

    Use registry.receives decorator in neutron.db.l3_db

    Switch to registry.receives decorator in neutron.db.l3_db.

    Partial-Bug: #1668262
    Change-Id: Ia8ac4f510c003667cac95f76dea0e9ae55159878

Changed in neutron:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.