use neutron-lib callbacks

The callback modules have been available in neutron-lib since commit [1]
and are ready for consumption.

As the callback registry is implemented with a singleton manager
instance, sync complications can arise ensuring all consumers switch to
lib's implementation at the same time. Therefore this consumption has
been broken down:
1) Shim neutron's callbacks using lib's callback system and remove
existing neutron internals related to callbacks (devref, UTs, etc.).
2) Switch all neutron's callback imports over to neutron-lib's.
3) Have all sub-projects using callbacks move their imports over to use
neutron-lib's callbacks implementation.
4) Remove the callback shims in neutron-lib once sub-projects are moved
over to lib's callbacks.
5) Follow-on patches moving our existing uses of callbacks to the new
event payload model provided by neutron-lib.callback.events

This patch implements #2 from above, moving all neutron's callback
imports to use neutron-lib's callbacks.

There are also a few places in the UT code that still patch callbacks,
we can address those in step #4 which may need [2].

NeutronLibImpact

[1] fea8bb64ba7ff52632c2bd3e3298eaedf623ee4f
[2] I9966c90e3f90552b41ed84a68b19f3e540426432

Change-Id: I8dae56f0f5c009bdf3e8ebfa1b360756216ab886
This commit is contained in:
Boden R 2017-04-17 07:07:13 -06:00
parent 7b7be92bfb
commit 0e2b667bf1
80 changed files with 219 additions and 211 deletions

View File

@ -15,6 +15,9 @@
import eventlet import eventlet
import netaddr import netaddr
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as lib_const from neutron_lib import constants as lib_const
from neutron_lib import context as n_context from neutron_lib import context as n_context
from oslo_config import cfg from oslo_config import cfg
@ -45,9 +48,6 @@ from neutron.agent.linux import ip_lib
from neutron.agent.linux import pd from neutron.agent.linux import pd
from neutron.agent.metadata import driver as metadata_driver from neutron.agent.metadata import driver as metadata_driver
from neutron.agent import rpc as agent_rpc from neutron.agent import rpc as agent_rpc
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as l3_constants from neutron.common import constants as l3_constants
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc
from neutron.common import ipv6_utils from neutron.common import ipv6_utils

View File

@ -17,6 +17,9 @@ import functools
import signal import signal
import eventlet import eventlet
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as n_const from neutron_lib import constants as n_const
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
@ -25,9 +28,6 @@ import six
from stevedore import driver from stevedore import driver
from neutron._i18n import _, _LE from neutron._i18n import _, _LE
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as l3_constants from neutron.common import constants as l3_constants
from neutron.common import utils from neutron.common import utils

View File

@ -18,6 +18,9 @@ import grp
import os import os
import pwd import pwd
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
@ -25,9 +28,6 @@ from neutron._i18n import _
from neutron.agent.l3 import ha_router from neutron.agent.l3 import ha_router
from neutron.agent.l3 import namespaces from neutron.agent.l3 import namespaces
from neutron.agent.linux import external_process from neutron.agent.linux import external_process
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants from neutron.common import constants
from neutron.common import exceptions from neutron.common import exceptions

View File

@ -13,6 +13,9 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from oslo_config import cfg from oslo_config import cfg
@ -20,9 +23,6 @@ from oslo_log import log as logging
import oslo_messaging import oslo_messaging
from neutron._i18n import _LE, _LW from neutron._i18n import _LE, _LW
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc
from neutron.common import topics from neutron.common import topics

View File

@ -13,12 +13,12 @@
import abc import abc
import collections import collections
from neutron_lib.callbacks import exceptions
from oslo_log import log as logging from oslo_log import log as logging
import six import six
from neutron.api.rpc.callbacks import exceptions as rpc_exc from neutron.api.rpc.callbacks import exceptions as rpc_exc
from neutron.api.rpc.callbacks import resources from neutron.api.rpc.callbacks import resources
from neutron.callbacks import exceptions
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -18,6 +18,7 @@ import itertools
import operator import operator
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import exceptions from neutron_lib import exceptions
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -28,7 +29,6 @@ import oslo_messaging
from oslo_utils import excutils from oslo_utils import excutils
from neutron._i18n import _, _LW from neutron._i18n import _, _LW
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc
from neutron.common import utils from neutron.common import utils

View File

@ -17,6 +17,8 @@ import collections
import copy import copy
import netaddr import netaddr
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib import exceptions from neutron_lib import exceptions
from oslo_log import log as logging from oslo_log import log as logging
from oslo_policy import policy as oslo_policy from oslo_policy import policy as oslo_policy
@ -27,8 +29,6 @@ from neutron._i18n import _, _LE, _LI
from neutron.api import api_common from neutron.api import api_common
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.api.v2 import resource as wsgi_resource from neutron.api.v2 import resource as wsgi_resource
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc

View File

@ -18,6 +18,9 @@ import datetime
import debtcollector import debtcollector
from eventlet import greenthread from eventlet import greenthread
from neutron_lib.api import converters from neutron_lib.api import converters
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -33,9 +36,6 @@ from sqlalchemy import sql
from neutron._i18n import _, _LE, _LI, _LW from neutron._i18n import _, _LE, _LI, _LW
from neutron.agent.common import utils from neutron.agent.common import utils
from neutron.api.rpc.callbacks import version_manager from neutron.api.rpc.callbacks import version_manager
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.db import _model_query as model_query from neutron.db import _model_query as model_query
from neutron.db import _utils as db_utils from neutron.db import _utils as db_utils

View File

@ -11,12 +11,12 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import utils from neutron.common import utils
from neutron.db import _resource_extend as resource_extend from neutron.db import _resource_extend as resource_extend
from neutron.db import l3_attrs_db from neutron.db import l3_attrs_db

View File

@ -17,6 +17,10 @@ import functools
import netaddr import netaddr
from neutron_lib.api import validators from neutron_lib.api import validators
from neutron_lib.callbacks import events
from neutron_lib.callbacks import exceptions
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context as ctx from neutron_lib import context as ctx
from neutron_lib import exceptions as exc from neutron_lib import exceptions as exc
@ -33,10 +37,6 @@ from sqlalchemy import not_
from neutron._i18n import _, _LE, _LI from neutron._i18n import _, _LE, _LI
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.callbacks import exceptions
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc
from neutron.common import ipv6_utils from neutron.common import ipv6_utils

View File

@ -14,6 +14,9 @@
# under the License. # under the License.
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -26,9 +29,6 @@ from sqlalchemy import or_
from sqlalchemy.orm import exc from sqlalchemy.orm import exc
from neutron._i18n import _, _LE from neutron._i18n import _, _LE
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import utils from neutron.common import utils
from neutron.db import api as db_api from neutron.db import api as db_api
from neutron.db.models import dvr as dvr_models from neutron.db.models import dvr as dvr_models

View File

@ -14,6 +14,9 @@
# under the License. # under the License.
from neutron_lib.api import validators from neutron_lib.api import validators
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -21,9 +24,6 @@ from sqlalchemy.sql import expression as expr
from neutron._i18n import _ from neutron._i18n import _
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import _model_query as model_query from neutron.db import _model_query as model_query
from neutron.db import _resource_extend as resource_extend from neutron.db import _resource_extend as resource_extend
from neutron.db import _utils as db_utils from neutron.db import _utils as db_utils

View File

@ -19,6 +19,10 @@ import random
from debtcollector import removals from debtcollector import removals
import netaddr import netaddr
from neutron_lib.api import validators from neutron_lib.api import validators
from neutron_lib.callbacks import events
from neutron_lib.callbacks import exceptions
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context as n_ctx from neutron_lib import context as n_ctx
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
@ -31,10 +35,6 @@ from sqlalchemy.orm import exc
from neutron._i18n import _, _LE, _LI, _LW from neutron._i18n import _, _LE, _LI, _LW
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.callbacks import events
from neutron.callbacks import exceptions
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import ipv6_utils from neutron.common import ipv6_utils
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc

View File

@ -15,6 +15,10 @@ import collections
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.api import validators from neutron_lib.api import validators
from neutron_lib.callbacks import events
from neutron_lib.callbacks import exceptions
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as const from neutron_lib import constants as const
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -25,10 +29,6 @@ from oslo_utils import excutils
import six import six
from neutron._i18n import _, _LE, _LI, _LW from neutron._i18n import _, _LE, _LI, _LW
from neutron.callbacks import events
from neutron.callbacks import exceptions
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as l3_const from neutron.common import constants as l3_const
from neutron.common import utils as n_utils from neutron.common import utils as n_utils
from neutron.db import api as db_api from neutron.db import api as db_api

View File

@ -14,14 +14,14 @@
# under the License. # under the License.
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as n_const from neutron_lib import constants as n_const
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from oslo_log import log as logging from oslo_log import log as logging
from sqlalchemy import or_ from sqlalchemy import or_
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import utils as n_utils from neutron.common import utils as n_utils
from neutron.db import agentschedulers_db from neutron.db import agentschedulers_db

View File

@ -19,6 +19,9 @@ import netaddr
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.api.definitions import provider_net as providernet from neutron_lib.api.definitions import provider_net as providernet
from neutron_lib.api import validators from neutron_lib.api import validators
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
from oslo_config import cfg from oslo_config import cfg
@ -33,9 +36,6 @@ from sqlalchemy import orm
from neutron._i18n import _, _LE, _LI, _LW from neutron._i18n import _, _LE, _LI, _LW
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import utils as n_utils from neutron.common import utils as n_utils
from neutron.db import _utils as db_utils from neutron.db import _utils as db_utils

View File

@ -13,13 +13,13 @@
# under the License. # under the License.
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from sqlalchemy import func from sqlalchemy import func
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import l3_agentschedulers_db as l3_sch_db from neutron.db import l3_agentschedulers_db as l3_sch_db
from neutron.db.models import agent as agent_model from neutron.db.models import agent as agent_model
from neutron.db.models import l3agent as rb_model from neutron.db.models import l3agent as rb_model

View File

@ -13,11 +13,11 @@
# under the License. # under the License.
# #
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from oslo_log import log as logging from oslo_log import log as logging
from neutron._i18n import _LE from neutron._i18n import _LE
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import api as db_api from neutron.db import api as db_api
from neutron.db import models_v2 from neutron.db import models_v2
from neutron.objects import provisioning_blocks as pb_obj from neutron.objects import provisioning_blocks as pb_obj

View File

@ -13,13 +13,13 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron_lib.callbacks import events
from neutron_lib.callbacks import exceptions as c_exc
from neutron_lib.callbacks import registry
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
from oslo_db import exception as db_exc from oslo_db import exception as db_exc
from sqlalchemy.orm import exc from sqlalchemy.orm import exc
from neutron.callbacks import events
from neutron.callbacks import exceptions as c_exc
from neutron.callbacks import registry
from neutron.db import _model_query as model_query from neutron.db import _model_query as model_query
from neutron.db import _utils as db_utils from neutron.db import _utils as db_utils
from neutron.db import api as db_api from neutron.db import api as db_api

View File

@ -14,6 +14,10 @@
import netaddr import netaddr
from neutron_lib.api import validators from neutron_lib.api import validators
from neutron_lib.callbacks import events
from neutron_lib.callbacks import exceptions
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib.utils import helpers from neutron_lib.utils import helpers
from oslo_utils import uuidutils from oslo_utils import uuidutils
@ -22,10 +26,6 @@ from sqlalchemy.orm import scoped_session
from neutron._i18n import _ from neutron._i18n import _
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.callbacks import exceptions
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import utils from neutron.common import utils
from neutron.db import _model_query as model_query from neutron.db import _model_query as model_query

View File

@ -10,13 +10,13 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import uuidutils from oslo_utils import uuidutils
from neutron._i18n import _LI from neutron._i18n import _LI
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import api as db_api from neutron.db import api as db_api
from neutron.db.models import segment as segments_model from neutron.db.models import segment as segments_model
from neutron.objects import base as base_obj from neutron.objects import base as base_obj

View File

@ -14,6 +14,9 @@
# under the License. # under the License.
from keystoneauth1 import loading as ks_loading from keystoneauth1 import loading as ks_loading
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
from neutron_lib import exceptions as exc from neutron_lib import exceptions as exc
@ -27,9 +30,6 @@ from oslo_utils import uuidutils
from sqlalchemy.orm import attributes as sql_attr from sqlalchemy.orm import attributes as sql_attr
from neutron._i18n import _LE, _LI, _LW from neutron._i18n import _LE, _LI, _LW
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.notifiers import batch_notifier from neutron.notifiers import batch_notifier

View File

@ -15,14 +15,14 @@
import abc import abc
import itertools import itertools
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib import exceptions as lib_exc from neutron_lib import exceptions as lib_exc
from six import add_metaclass from six import add_metaclass
from six import with_metaclass from six import with_metaclass
from sqlalchemy import and_ from sqlalchemy import and_
from neutron._i18n import _ from neutron._i18n import _
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc
from neutron.db import _utils as db_utils from neutron.db import _utils as db_utils
from neutron.db import api as db_api from neutron.db import api as db_api

View File

@ -13,11 +13,11 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from oslo_log import log from oslo_log import log
from pecan import hooks from pecan import hooks
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc
from neutron.pecan_wsgi import constants as pecan_constants from neutron.pecan_wsgi import constants as pecan_constants
from neutron.pecan_wsgi.hooks import utils from neutron.pecan_wsgi.hooks import utils

View File

@ -15,6 +15,9 @@
from debtcollector import removals from debtcollector import removals
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as n_const from neutron_lib import constants as n_const
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from oslo_db import exception as db_exc from oslo_db import exception as db_exc
@ -25,9 +28,6 @@ from sqlalchemy import or_
from sqlalchemy.orm import exc from sqlalchemy.orm import exc
from neutron._i18n import _, _LE from neutron._i18n import _, _LE
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import api as db_api from neutron.db import api as db_api
from neutron.db.models import securitygroup as sg_models from neutron.db.models import securitygroup as sg_models
from neutron.db import models_v2 from neutron.db import models_v2

View File

@ -19,6 +19,9 @@ import contextlib
import sys import sys
import time import time
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources as local_resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
from oslo_config import cfg from oslo_config import cfg
@ -34,9 +37,6 @@ from neutron.agent import rpc as agent_rpc
from neutron.agent import securitygroups_rpc as agent_sg_rpc from neutron.agent import securitygroups_rpc as agent_sg_rpc
from neutron.api.rpc.callbacks import resources from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources as local_resources
from neutron.common import config as common_config from neutron.common import config as common_config
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import topics from neutron.common import topics

View File

@ -11,8 +11,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron.callbacks import events from neutron_lib.callbacks import events
from neutron.callbacks import registry from neutron_lib.callbacks import registry
def notify_init_event(agent_type, agent): def notify_init_event(agent_type, agent):

View File

@ -16,12 +16,12 @@
import abc import abc
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import resources
from neutron_lib import constants as const from neutron_lib import constants as const
from oslo_log import log from oslo_log import log
import six import six
from neutron._i18n import _LW from neutron._i18n import _LW
from neutron.callbacks import resources
from neutron.db import provisioning_blocks from neutron.db import provisioning_blocks
from neutron.plugins.common import constants as p_constants from neutron.plugins.common import constants as p_constants
from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2 import driver_api as api

View File

@ -23,6 +23,9 @@ import time
import netaddr import netaddr
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events as callback_events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources as callback_resources
from neutron_lib import constants as n_const from neutron_lib import constants as n_const
from neutron_lib import context from neutron_lib import context
from neutron_lib.utils import helpers from neutron_lib.utils import helpers
@ -47,9 +50,6 @@ from neutron.agent import securitygroups_rpc as agent_sg_rpc
from neutron.api.rpc.callbacks import resources from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import dvr_rpc from neutron.api.rpc.handlers import dvr_rpc
from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc
from neutron.callbacks import events as callback_events
from neutron.callbacks import registry
from neutron.callbacks import resources as callback_resources
from neutron.common import config from neutron.common import config
from neutron.common import constants as c_const from neutron.common import constants as c_const
from neutron.common import topics from neutron.common import topics

View File

@ -16,12 +16,12 @@
import os import os
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib import constants from neutron_lib import constants
from oslo_config import cfg from oslo_config import cfg
from neutron.agent import securitygroups_rpc from neutron.agent import securitygroups_rpc
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.plugins.common import constants as p_constants from neutron.plugins.common import constants as p_constants
from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2 import driver_api as api
from neutron.plugins.ml2.drivers import mech_agent from neutron.plugins.ml2.drivers import mech_agent

View File

@ -14,14 +14,14 @@
# under the License. # under the License.
from neutron_lib.api import validators from neutron_lib.api import validators
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from neutron._i18n import _LE, _LI from neutron._i18n import _LE, _LI
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import models_v2 from neutron.db import models_v2
from neutron.db import segments_db from neutron.db import segments_db
from neutron.extensions import dns from neutron.extensions import dns

View File

@ -14,6 +14,9 @@
import traceback import traceback
import eventlet import eventlet
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import context as n_ctx from neutron_lib import context as n_ctx
from oslo_concurrency import lockutils from oslo_concurrency import lockutils
from oslo_log import log as logging from oslo_log import log as logging
@ -21,9 +24,6 @@ from oslo_log import log as logging
from neutron._i18n import _LE from neutron._i18n import _LE
from neutron.api.rpc.callbacks import events as rpc_events from neutron.api.rpc.callbacks import events as rpc_events
from neutron.api.rpc.handlers import resources_rpc from neutron.api.rpc.handlers import resources_rpc
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import api as db_api from neutron.db import api as db_api
from neutron.objects import network from neutron.objects import network
from neutron.objects import ports from neutron.objects import ports

View File

@ -19,6 +19,10 @@ from eventlet import greenthread
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.api.definitions import provider_net from neutron_lib.api.definitions import provider_net
from neutron_lib.api import validators from neutron_lib.api import validators
from neutron_lib.callbacks import events
from neutron_lib.callbacks import exceptions
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as const from neutron_lib import constants as const
from neutron_lib import exceptions as exc from neutron_lib import exceptions as exc
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -42,10 +46,6 @@ from neutron.api.rpc.handlers import metadata_rpc
from neutron.api.rpc.handlers import resources_rpc from neutron.api.rpc.handlers import resources_rpc
from neutron.api.rpc.handlers import securitygroups_rpc from neutron.api.rpc.handlers import securitygroups_rpc
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.callbacks import exceptions
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc
from neutron.common import topics from neutron.common import topics

View File

@ -14,6 +14,7 @@
# under the License. # under the License.
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import resources
from neutron_lib import constants as n_const from neutron_lib import constants as n_const
from neutron_lib import exceptions from neutron_lib import exceptions
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -24,7 +25,6 @@ from sqlalchemy.orm import exc
from neutron._i18n import _LE, _LW from neutron._i18n import _LE, _LW
from neutron.api.rpc.handlers import dvr_rpc from neutron.api.rpc.handlers import dvr_rpc
from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc from neutron.api.rpc.handlers import securitygroups_rpc as sg_rpc
from neutron.callbacks import resources
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc
from neutron.common import topics from neutron.common import topics
from neutron.db import l3_hamode_db from neutron.db import l3_hamode_db

View File

@ -17,6 +17,9 @@ import inspect
import os import os
import random import random
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import context from neutron_lib import context
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from oslo_concurrency import processutils from oslo_concurrency import processutils
@ -29,9 +32,6 @@ from oslo_utils import excutils
from oslo_utils import importutils from oslo_utils import importutils
from neutron._i18n import _LE, _LI from neutron._i18n import _LE, _LI
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import config from neutron.common import config
from neutron.common import profiler from neutron.common import profiler
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc

View File

@ -14,6 +14,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -21,9 +24,6 @@ from oslo_log import log as logging
from neutron._i18n import _, _LE from neutron._i18n import _, _LE
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import exceptions as c_exc from neutron.common import exceptions as c_exc
from neutron.db import _resource_extend as resource_extend from neutron.db import _resource_extend as resource_extend
from neutron.db import _utils as db_utils from neutron.db import _utils as db_utils

View File

@ -12,6 +12,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as lib_const from neutron_lib import constants as lib_const
from neutron_lib import exceptions as lib_exc from neutron_lib import exceptions as lib_exc
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -19,9 +22,6 @@ from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from neutron._i18n import _ from neutron._i18n import _
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import servicetype_db as st_db from neutron.db import servicetype_db as st_db
from neutron.plugins.common import constants from neutron.plugins.common import constants
from neutron.services import provider_configuration from neutron.services import provider_configuration

View File

@ -15,10 +15,10 @@
# under the License. # under the License.
from neutron_lib.api import validators as lib_validators from neutron_lib.api import validators as lib_validators
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from oslo_log import log as logging from oslo_log import log as logging
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.services.qos import qos_consts from neutron.services.qos import qos_consts
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)

View File

@ -11,6 +11,8 @@
# under the License. # under the License.
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from oslo_log import log as logging from oslo_log import log as logging
from oslo_utils import excutils from oslo_utils import excutils
@ -19,8 +21,6 @@ from neutron.api.rpc.callbacks import events as rpc_events
from neutron.api.rpc.callbacks.producer import registry as rpc_registry from neutron.api.rpc.callbacks.producer import registry as rpc_registry
from neutron.api.rpc.callbacks import resources from neutron.api.rpc.callbacks import resources
from neutron.api.rpc.handlers import resources_rpc from neutron.api.rpc.handlers import resources_rpc
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.objects.qos import policy as policy_object from neutron.objects.qos import policy as policy_object
from neutron.services.qos import qos_consts from neutron.services.qos import qos_consts

View File

@ -13,9 +13,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron.callbacks import events as callbacks_events from neutron_lib.callbacks import events as callbacks_events
from neutron.callbacks import registry as callbacks_registry from neutron_lib.callbacks import registry as callbacks_registry
from neutron.callbacks import resources as callbacks_resources from neutron_lib.callbacks import resources as callbacks_resources
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc
from neutron.db import api as db_api from neutron.db import api as db_api
from neutron.db import db_base_plugin_common from neutron.db import db_base_plugin_common

View File

@ -14,7 +14,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -22,9 +24,6 @@ from oslo_db import exception as db_exc
from oslo_log import helpers as log_helpers from oslo_log import helpers as log_helpers
from oslo_utils import uuidutils from oslo_utils import uuidutils
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import _utils as db_utils from neutron.db import _utils as db_utils
from neutron.db import api as db_api from neutron.db import api as db_api
from neutron.db import common_db_mixin from neutron.db import common_db_mixin

View File

@ -16,6 +16,9 @@
from keystoneauth1 import loading as ks_loading from keystoneauth1 import loading as ks_loading
import netaddr import netaddr
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from novaclient import client as nova_client from novaclient import client as nova_client
@ -25,9 +28,6 @@ from oslo_log import log
from neutron._i18n import _, _LE, _LI from neutron._i18n import _, _LE, _LI
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc
from neutron.db import _resource_extend as resource_extend from neutron.db import _resource_extend as resource_extend
from neutron.db import api as db_api from neutron.db import api as db_api

View File

@ -15,8 +15,9 @@
import abc import abc
from neutron.callbacks import events from neutron_lib.callbacks import events
from neutron.callbacks import registry from neutron_lib.callbacks import registry
from neutron.services.trunk import constants as trunk_consts from neutron.services.trunk import constants as trunk_consts
from neutron.services.trunk.rpc import backend from neutron.services.trunk.rpc import backend
@ -75,7 +76,7 @@ class DriverBase(object):
register() method invocation. register() method invocation.
:param resource: neutron.services.trunk.constants.TRUNK_PLUGIN :param resource: neutron.services.trunk.constants.TRUNK_PLUGIN
:param event: neutron.callbacks.events.AFTER_INIT :param event: neutron_lib.callbacks.events.AFTER_INIT
:param trigger: neutron.service.trunks.plugin.TrunkPlugin :param trigger: neutron.service.trunks.plugin.TrunkPlugin
""" """

View File

@ -11,15 +11,15 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron_lib.callbacks import events as local_events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources as local_resources
from oslo_log import log as logging from oslo_log import log as logging
import oslo_messaging import oslo_messaging
from neutron._i18n import _LE from neutron._i18n import _LE
from neutron.api.rpc.callbacks import events from neutron.api.rpc.callbacks import events
from neutron.api.rpc.handlers import resources_rpc from neutron.api.rpc.handlers import resources_rpc
from neutron.callbacks import events as local_events
from neutron.callbacks import registry
from neutron.callbacks import resources as local_resources
from neutron.services.trunk import constants as t_const from neutron.services.trunk import constants as t_const
from neutron.services.trunk.drivers.linuxbridge.agent import trunk_plumber from neutron.services.trunk.drivers.linuxbridge.agent import trunk_plumber
from neutron.services.trunk.rpc import agent as trunk_rpc from neutron.services.trunk.rpc import agent as trunk_rpc

View File

@ -16,6 +16,8 @@
import functools import functools
import eventlet import eventlet
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib import context as n_context from neutron_lib import context as n_context
from oslo_concurrency import lockutils from oslo_concurrency import lockutils
from oslo_context import context as o_context from oslo_context import context as o_context
@ -26,8 +28,6 @@ from oslo_serialization import jsonutils
from neutron._i18n import _, _LE from neutron._i18n import _, _LE
from neutron.agent.common import ovs_lib from neutron.agent.common import ovs_lib
from neutron.api.rpc.handlers import resources_rpc from neutron.api.rpc.handlers import resources_rpc
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.common import utils as common_utils from neutron.common import utils as common_utils
from neutron.plugins.ml2.drivers.openvswitch.agent.common \ from neutron.plugins.ml2.drivers.openvswitch.agent.common \
import constants as ovs_agent_constants import constants as ovs_agent_constants

View File

@ -12,12 +12,12 @@
# under the License. # under the License.
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib import constants from neutron_lib import constants
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log as logging from oslo_log import log as logging
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.plugins.ml2.drivers.openvswitch.agent.common import ( from neutron.plugins.ml2.drivers.openvswitch.agent.common import (
constants as agent_consts) constants as agent_consts)
from neutron.services.trunk import constants as trunk_consts from neutron.services.trunk import constants as trunk_consts

View File

@ -15,6 +15,9 @@
import copy import copy
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import context from neutron_lib import context
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from neutron_lib.services import base as service_base from neutron_lib.services import base as service_base
@ -22,9 +25,6 @@ from oslo_log import log as logging
from oslo_utils import uuidutils from oslo_utils import uuidutils
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import _resource_extend as resource_extend from neutron.db import _resource_extend as resource_extend
from neutron.db import api as db_api from neutron.db import api as db_api
from neutron.db import common_db_mixin from neutron.db import common_db_mixin

View File

@ -12,10 +12,10 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from oslo_log import log as logging from oslo_log import log as logging
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.services.trunk import constants as trunk_consts from neutron.services.trunk import constants as trunk_consts
from neutron.services.trunk.rpc import server from neutron.services.trunk.rpc import server

View File

@ -26,6 +26,7 @@ import os.path
import eventlet.timeout import eventlet.timeout
import fixtures import fixtures
import mock import mock
from neutron_lib.callbacks import manager as registry_manager
from neutron_lib import fixture from neutron_lib import fixture
from oslo_concurrency.fixture import lockutils from oslo_concurrency.fixture import lockutils
from oslo_config import cfg from oslo_config import cfg
@ -42,7 +43,6 @@ from neutron._i18n import _
from neutron.agent.linux import external_process from neutron.agent.linux import external_process
from neutron.api.rpc.callbacks.consumer import registry as rpc_consumer_reg from neutron.api.rpc.callbacks.consumer import registry as rpc_consumer_reg
from neutron.api.rpc.callbacks.producer import registry as rpc_producer_reg from neutron.api.rpc.callbacks.producer import registry as rpc_producer_reg
from neutron.callbacks import manager as registry_manager
from neutron.common import config from neutron.common import config
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc
from neutron.db import _model_query as model_query from neutron.db import _model_query as model_query

View File

@ -16,14 +16,14 @@
import copy import copy
import mock import mock
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as lib_constants from neutron_lib import constants as lib_constants
from neutron.agent.l3 import namespace_manager from neutron.agent.l3 import namespace_manager
from neutron.agent.l3 import namespaces from neutron.agent.l3 import namespaces
from neutron.agent.linux import ip_lib from neutron.agent.linux import ip_lib
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import utils from neutron.common import utils
from neutron.tests.common import machine_fixtures from neutron.tests.common import machine_fixtures
from neutron.tests.common import net_helpers from neutron.tests.common import net_helpers

View File

@ -17,9 +17,10 @@
import mock import mock
import time import time
from neutron.callbacks import events from neutron_lib.callbacks import events
from neutron.callbacks import registry from neutron_lib.callbacks import registry
from neutron.callbacks import resources from neutron_lib.callbacks import resources
from neutron.common import utils from neutron.common import utils
from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants from neutron.plugins.ml2.drivers.openvswitch.agent.common import constants
from neutron.tests.common import net_helpers from neutron.tests.common import net_helpers

View File

@ -14,6 +14,7 @@
# under the License. # under the License.
import mock import mock
from neutron_lib.callbacks import events
from neutron_lib import context from neutron_lib import context
from neutron_lib.db import constants as db_const from neutron_lib.db import constants as db_const
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
@ -21,7 +22,6 @@ from oslo_policy import policy as oslo_policy
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.db.quota import driver as quota_driver from neutron.db.quota import driver as quota_driver
from neutron import manager from neutron import manager
from neutron.pecan_wsgi.controllers import resource from neutron.pecan_wsgi.controllers import resource

View File

@ -14,13 +14,14 @@
import mock import mock
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
from neutron.api.rpc.handlers import l3_rpc from neutron.api.rpc.handlers import l3_rpc
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import topics from neutron.common import topics
from neutron.extensions import external_net from neutron.extensions import external_net

View File

@ -16,13 +16,13 @@
import datetime import datetime
import mock import mock
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from oslo_utils import timeutils from oslo_utils import timeutils
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import utils from neutron.common import utils
from neutron.db.agentschedulers_db import cfg from neutron.db.agentschedulers_db import cfg
from neutron.db.models import agent as agent_model from neutron.db.models import agent as agent_model

View File

@ -12,9 +12,10 @@
import mock import mock
from neutron_lib.callbacks import exceptions
from neutron.api.rpc.callbacks import exceptions as rpc_exc from neutron.api.rpc.callbacks import exceptions as rpc_exc
from neutron.api.rpc.callbacks import resource_manager from neutron.api.rpc.callbacks import resource_manager
from neutron.callbacks import exceptions as exceptions
from neutron.tests.unit.services.qos import base from neutron.tests.unit.services.qos import base
IS_VALID_RESOURCE_TYPE = ( IS_VALID_RESOURCE_TYPE = (

View File

@ -15,13 +15,13 @@
import mock import mock
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from oslo_db import exception as db_exc from oslo_db import exception as db_exc
from neutron.api.rpc.handlers import dhcp_rpc from neutron.api.rpc.handlers import dhcp_rpc
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import exceptions from neutron.common import exceptions
from neutron.common import utils from neutron.common import utils

View File

@ -17,6 +17,7 @@ import os
import mock import mock
from neutron_lib.api import converters from neutron_lib.api import converters
from neutron_lib.callbacks import registry
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
@ -36,7 +37,6 @@ from neutron.api import extensions
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.api.v2 import base as v2_base from neutron.api.v2 import base as v2_base
from neutron.api.v2 import router from neutron.api.v2 import router
from neutron.callbacks import registry
from neutron import policy from neutron import policy
from neutron import quota from neutron import quota
from neutron.quota import resource_registry from neutron.quota import resource_registry

View File

@ -21,6 +21,8 @@ import itertools
import eventlet import eventlet
import mock import mock
import netaddr import netaddr
from neutron_lib.callbacks import exceptions
from neutron_lib.callbacks import registry
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
from neutron_lib import exceptions as lib_exc from neutron_lib import exceptions as lib_exc
@ -41,8 +43,6 @@ import neutron
from neutron.api import api_common from neutron.api import api_common
from neutron.api import extensions from neutron.api import extensions
from neutron.api.v2 import router from neutron.api.v2 import router
from neutron.callbacks import exceptions
from neutron.callbacks import registry
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.common import exceptions as n_exc from neutron.common import exceptions as n_exc
from neutron.common import ipv6_utils from neutron.common import ipv6_utils

View File

@ -15,13 +15,13 @@
import mock import mock
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import api as db_api from neutron.db import api as db_api
from neutron.db import dvr_mac_db from neutron.db import dvr_mac_db
from neutron.db.models import dvr as dvr_models from neutron.db.models import dvr as dvr_models

View File

@ -14,14 +14,14 @@
# limitations under the License. # limitations under the License.
import mock import mock
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as n_const from neutron_lib import constants as n_const
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
import testtools import testtools
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import l3_db from neutron.db import l3_db
from neutron.db.models import l3 as l3_models from neutron.db.models import l3 as l3_models
from neutron.extensions import l3 from neutron.extensions import l3

View File

@ -15,15 +15,15 @@
import mock import mock
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as const from neutron_lib import constants as const
from neutron_lib import context from neutron_lib import context
from neutron_lib import exceptions from neutron_lib import exceptions
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from oslo_utils import uuidutils from oslo_utils import uuidutils
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import agents_db from neutron.db import agents_db
from neutron.db import common_db_mixin from neutron.db import common_db_mixin
from neutron.db import l3_agentschedulers_db from neutron.db import l3_agentschedulers_db

View File

@ -16,6 +16,10 @@ import mock
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.api.definitions import provider_net as providernet from neutron_lib.api.definitions import provider_net as providernet
from neutron_lib.callbacks import events
from neutron_lib.callbacks import exceptions as c_exc
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
@ -29,10 +33,6 @@ import testtools
from neutron.agent.common import utils as agent_utils from neutron.agent.common import utils as agent_utils
from neutron.api.rpc.handlers import l3_rpc from neutron.api.rpc.handlers import l3_rpc
from neutron.callbacks import events
from neutron.callbacks import exceptions as c_exc
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.db import agents_db from neutron.db import agents_db
from neutron.db import common_db_mixin from neutron.db import common_db_mixin

View File

@ -13,11 +13,11 @@
# under the License. # under the License.
import mock import mock
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import context as n_ctx from neutron_lib import context as n_ctx
import testtools import testtools
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import api as db_api from neutron.db import api as db_api
from neutron.db import models_v2 from neutron.db import models_v2
from neutron.db import provisioning_blocks as pb from neutron.db import provisioning_blocks as pb

View File

@ -15,10 +15,10 @@
import mock import mock
from neutron_lib.callbacks import events
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
from neutron.callbacks import events
from neutron.db.db_base_plugin_v2 import NeutronDbPluginV2 as db_plugin_v2 from neutron.db.db_base_plugin_v2 import NeutronDbPluginV2 as db_plugin_v2
from neutron.extensions import rbac as ext_rbac from neutron.extensions import rbac as ext_rbac
from neutron.tests.unit.db import test_db_base_plugin_v2 as test_plugin from neutron.tests.unit.db import test_db_base_plugin_v2 as test_plugin

View File

@ -12,15 +12,15 @@
# limitations under the License. # limitations under the License.
import mock import mock
from neutron_lib.callbacks import events
from neutron_lib.callbacks import exceptions
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
import sqlalchemy import sqlalchemy
import testtools import testtools
from neutron.callbacks import events
from neutron.callbacks import exceptions
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import common_db_mixin from neutron.db import common_db_mixin
from neutron.db import securitygroups_db from neutron.db import securitygroups_db
from neutron.extensions import securitygroup from neutron.extensions import securitygroup

View File

@ -16,14 +16,14 @@ import contextlib
import mock import mock
import netaddr import netaddr
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
import webob.exc import webob.exc
from neutron.api.v2 import attributes as attr from neutron.api.v2 import attributes as attr
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import address_scope_db from neutron.db import address_scope_db
from neutron.db import db_base_plugin_v2 from neutron.db import db_base_plugin_v2
from neutron.extensions import address_scope as ext_address_scope from neutron.extensions import address_scope as ext_address_scope

View File

@ -20,6 +20,10 @@ import copy
import mock import mock
import netaddr import netaddr
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import exceptions
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as lib_constants from neutron_lib import constants as lib_constants
from neutron_lib import context from neutron_lib import context
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
@ -34,10 +38,6 @@ from webob import exc
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.rpc.handlers import l3_rpc from neutron.api.rpc.handlers import l3_rpc
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.callbacks import exceptions
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.db import _resource_extend as resource_extend from neutron.db import _resource_extend as resource_extend
from neutron.db import common_db_mixin from neutron.db import common_db_mixin
from neutron.db import db_base_plugin_v2 from neutron.db import db_base_plugin_v2

View File

@ -18,6 +18,10 @@ from keystoneauth1 import exceptions as ks_exc
import mock import mock
import netaddr import netaddr
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import exceptions
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
@ -28,10 +32,6 @@ from oslo_utils import uuidutils
import webob.exc import webob.exc
from neutron.api.v2 import attributes from neutron.api.v2 import attributes
from neutron.callbacks import events
from neutron.callbacks import exceptions
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import exceptions as neutron_exc from neutron.common import exceptions as neutron_exc
from neutron.conf.plugins.ml2.drivers import driver_type from neutron.conf.plugins.ml2.drivers import driver_type
from neutron.db import agents_db from neutron.db import agents_db

View File

@ -12,6 +12,7 @@
import mock import mock
from neutron_lib.callbacks import events
from neutron_lib import context as n_context from neutron_lib import context as n_context
from neutron_lib.db import model_base from neutron_lib.db import model_base
from neutron_lib import exceptions as n_exc from neutron_lib import exceptions as n_exc
@ -19,7 +20,6 @@ from oslo_versionedobjects import base as obj_base
from oslo_versionedobjects import fields as obj_fields from oslo_versionedobjects import fields as obj_fields
import sqlalchemy as sa import sqlalchemy as sa
from neutron.callbacks import events
from neutron.db import rbac_db_models from neutron.db import rbac_db_models
from neutron.extensions import rbac as ext_rbac from neutron.extensions import rbac as ext_rbac
from neutron.objects import common_types from neutron.objects import common_types

View File

@ -15,14 +15,14 @@
# under the License. # under the License.
import mock import mock
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from oslo_config import cfg from oslo_config import cfg
import testtools import testtools
from neutron.agent.linux import bridge_lib from neutron.agent.linux import bridge_lib
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import constants as n_const from neutron.common import constants as n_const
from neutron.plugins.ml2.drivers.agent import _agent_manager_base as amb from neutron.plugins.ml2.drivers.agent import _agent_manager_base as amb
from neutron.plugins.ml2.drivers.agent import _common_agent as ca from neutron.plugins.ml2.drivers.agent import _common_agent as ca

View File

@ -12,15 +12,16 @@
# under the License. # under the License.
import mock import mock
from neutron_lib.callbacks import events
from neutron.callbacks import events
from neutron.plugins.ml2.drivers.agent import capabilities from neutron.plugins.ml2.drivers.agent import capabilities
from neutron.tests import base from neutron.tests import base
class CapabilitiesTest(base.BaseTestCase): class CapabilitiesTest(base.BaseTestCase):
@mock.patch("neutron.callbacks.manager.CallbacksManager.notify") # TODO(boden) replace with neutron_lib fixture once working
@mock.patch("neutron_lib.callbacks.manager.CallbacksManager.notify")
def test_notify_init_event(self, mocked_manager): def test_notify_init_event(self, mocked_manager):
mock_agent_type = mock.Mock() mock_agent_type = mock.Mock()
mock_agent = mock.Mock() mock_agent = mock.Mock()
@ -30,7 +31,8 @@ class CapabilitiesTest(base.BaseTestCase):
mock_agent, mock_agent,
agent=mock_agent) agent=mock_agent)
@mock.patch("neutron.callbacks.manager.CallbacksManager.subscribe") # TODO(boden) replace with neutron_lib fixture once working
@mock.patch("neutron_lib.callbacks.manager.CallbacksManager.subscribe")
def test_register(self, mocked_subscribe): def test_register(self, mocked_subscribe):
mock_callback = mock.Mock() mock_callback = mock.Mock()
mock_agent_type = mock.Mock() mock_agent_type = mock.Mock()

View File

@ -13,7 +13,8 @@
import mock import mock
from neutron.callbacks import events from neutron_lib.callbacks import events
from neutron.plugins.ml2.drivers.openvswitch.agent import ovs_capabilities from neutron.plugins.ml2.drivers.openvswitch.agent import ovs_capabilities
from neutron.services.trunk.drivers.openvswitch.agent import driver from neutron.services.trunk.drivers.openvswitch.agent import driver
from neutron.tests import base from neutron.tests import base
@ -22,7 +23,8 @@ from neutron_lib import constants
class CapabilitiesTest(base.BaseTestCase): class CapabilitiesTest(base.BaseTestCase):
@mock.patch("neutron.callbacks.manager.CallbacksManager.subscribe") # TODO(boden) replace with neutron_lib fixture once working
@mock.patch("neutron_lib.callbacks.manager.CallbacksManager.subscribe")
def test_register(self, mocked_subscribe): def test_register(self, mocked_subscribe):
ovs_capabilities.register() ovs_capabilities.register()
mocked_subscribe.assert_called_with(driver.init_handler, mocked_subscribe.assert_called_with(driver.init_handler,

View File

@ -14,11 +14,11 @@
# under the License. # under the License.
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib import constants from neutron_lib import constants
from oslo_config import cfg from oslo_config import cfg
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.plugins.ml2 import driver_api as api from neutron.plugins.ml2 import driver_api as api
from neutron.plugins.ml2.drivers.openvswitch.agent.common import ( from neutron.plugins.ml2.drivers.openvswitch.agent.common import (
constants as a_const) constants as a_const)

View File

@ -22,6 +22,10 @@ import webob
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.api.definitions import provider_net as pnet from neutron_lib.api.definitions import provider_net as pnet
from neutron_lib.callbacks import events
from neutron_lib.callbacks import exceptions as c_exc
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib import context from neutron_lib import context
from neutron_lib import exceptions as exc from neutron_lib import exceptions as exc
@ -30,10 +34,6 @@ from oslo_db import exception as db_exc
from oslo_utils import uuidutils from oslo_utils import uuidutils
from neutron._i18n import _ from neutron._i18n import _
from neutron.callbacks import events
from neutron.callbacks import exceptions as c_exc
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.common import utils from neutron.common import utils
from neutron.db import agents_db from neutron.db import agents_db
from neutron.db import api as db_api from neutron.db import api as db_api

View File

@ -20,6 +20,7 @@ Unit Tests for ml2 rpc
import collections import collections
import mock import mock
from neutron_lib.callbacks import resources
from neutron_lib import constants from neutron_lib import constants
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from oslo_config import cfg from oslo_config import cfg
@ -27,7 +28,6 @@ from oslo_context import context as oslo_context
from sqlalchemy.orm import exc from sqlalchemy.orm import exc
from neutron.agent import rpc as agent_rpc from neutron.agent import rpc as agent_rpc
from neutron.callbacks import resources
from neutron.common import topics from neutron.common import topics
from neutron.db import provisioning_blocks from neutron.db import provisioning_blocks
from neutron.plugins.ml2.drivers import type_tunnel from neutron.plugins.ml2.drivers import type_tunnel

View File

@ -17,13 +17,13 @@
import math import math
import mock import mock
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib import constants as const from neutron_lib import constants as const
from neutron_lib import context from neutron_lib import context
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.extensions import securitygroup as ext_sg from neutron.extensions import securitygroup as ext_sg
from neutron.tests import tools from neutron.tests import tools
from neutron.tests.unit.agent import test_securitygroups_rpc as test_sg_rpc from neutron.tests.unit.agent import test_securitygroups_rpc as test_sg_rpc

View File

@ -13,11 +13,11 @@
import mock import mock
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib import constants from neutron_lib import constants
from oslo_config import cfg from oslo_config import cfg
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.plugins.ml2.drivers.openvswitch.agent.common import ( from neutron.plugins.ml2.drivers.openvswitch.agent.common import (
constants as agent_consts) constants as agent_consts)
from neutron.services.trunk.drivers.openvswitch import driver from neutron.services.trunk.drivers.openvswitch import driver

View File

@ -12,9 +12,9 @@
# under the License. # under the License.
import mock import mock
from neutron_lib.callbacks import events
from neutron.api.rpc.callbacks import resource_manager from neutron.api.rpc.callbacks import resource_manager
from neutron.callbacks import events
from neutron.services.trunk import callbacks from neutron.services.trunk import callbacks
from neutron.services.trunk import constants as trunk_consts from neutron.services.trunk import constants as trunk_consts
from neutron.services.trunk.rpc import backend from neutron.services.trunk.rpc import backend
@ -28,7 +28,8 @@ class ServerSideRpcBackendTest(base.BaseTestCase):
self.register_mock = mock.patch.object( self.register_mock = mock.patch.object(
resource_manager.ResourceCallbacksManager, "register").start() resource_manager.ResourceCallbacksManager, "register").start()
@mock.patch("neutron.callbacks.manager.CallbacksManager.subscribe") # TODO(boden) replace with neutron_lib fixture once working
@mock.patch("neutron_lib.callbacks.manager.CallbacksManager.subscribe")
def test___init__(self, mocked_subscribe): def test___init__(self, mocked_subscribe):
test_obj = backend.ServerSideRpcBackend() test_obj = backend.ServerSideRpcBackend()

View File

@ -15,12 +15,12 @@
import mock import mock
from neutron_lib.api.definitions import portbindings from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from neutron_lib.plugins import directory from neutron_lib.plugins import directory
import testtools import testtools
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
from neutron.objects import trunk as trunk_objects from neutron.objects import trunk as trunk_objects
from neutron.services.trunk import callbacks from neutron.services.trunk import callbacks
from neutron.services.trunk import constants from neutron.services.trunk import constants

View File

@ -10,13 +10,12 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron_lib.callbacks import events
from neutron_lib.callbacks import registry
from neutron_lib.callbacks import resources
from oslo_service import loopingcall from oslo_service import loopingcall
from oslo_service import service from oslo_service import service
from neutron.callbacks import events
from neutron.callbacks import registry
from neutron.callbacks import resources
class WorkerSupportServiceMixin(object): class WorkerSupportServiceMixin(object):