Import neutron.db.api module in common.utils

Patch [1] removed import of neutron.db.api module in
neutron.common.utils.
This cause some issues e.g. in networking-ovn projects because
listeners:

@event.listens_for(orm.session.Session, "persistent_to_deleted")
on _persistent_to_deleted() function [2] and

@event.listens_for(model_base.BASEV2, "attribute_instrument", propagate=True)
on _listen_for_changes() function [3]

aren't created as they where before.

This patch adds import of this neutron.db.api module again just to
ensure that those listeners are created properly.

[1] https://review.openstack.org/#/c/614252/
[2] https://github.com/openstack/neutron/blob/master/neutron/db/api.py#L110
[3] https://github.com/openstack/neutron/blob/master/neutron/db/api.py#L134

Closes-Bug: #1802369

Change-Id: I3e427ee5c904c34115aaf1afa67e1109ea58d603
This commit is contained in:
Slawek Kaplonski 2018-11-10 15:48:20 +01:00
parent 094095b3d7
commit 593c04d10d
1 changed files with 1 additions and 0 deletions

View File

@ -45,6 +45,7 @@ import six
import neutron
from neutron._i18n import _
from neutron.api import api_common
from neutron.db import api # noqa
TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
LOG = logging.getLogger(__name__)