Comment 4 for bug 1677636

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

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

commit 8a0faef877a18d931178a2ed1d55734aa91e32d3
Author: Ihar Hrachyshka <email address hidden>
Date: Thu Mar 30 15:56:29 2017 +0000

    TestTrackedResource: register core plugin in directory

    This is achieved by switching the test class to BaseTestCase and using
    setup_coreplugin. This makes later calls to neutron.objects.db.api
    functions that extract the plugin from plugins directory to work.

    The test class registers some sqlalchemy events for models not
    registered in BASEV2, which later makes unregister_events fail because
    of failure to compare those model classes with other registered model
    classes (those that belong to proper model classes like Port). Before
    the patch, the core plugin was not correctly registered in plugins
    directory, and no code was actually loading the plugin, so no other
    sqla events were in _REGISTERED_SQLA_EVENTS, which explains why
    previously calls to unregister_events hasn't failed.

    Good news is that the new parent class does clean up all events itself,
    so we don't need to set the cleanup hook ourselves.

    This switch also facilitated removal of some other preparatory steps
    from the class that are already implemented in the new parent.

    Closes-Bug: #1677636
    Change-Id: Id462e532066ac3cd5e2f76c3670da7f7820c6581