- [N320] Validate that LOG messages, except debug ones, have translations
- [N321] Validate that jsonutils module is used instead of json
- [N322] Detect common errors with assert_called_once_with
+- [N323] Enforce namespace-less imports for oslo libraries
Creating Unit Tests
-------------------
import os
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import config
from neutron.openstack.common import log as logging
import eventlet
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import importutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_utils import importutils
from neutron.agent.common import config
from neutron.agent.linux import dhcp
client side to execute the methods here. For more information about
changing rpc interfaces, see doc/source/devref/rpc_api.rst.
"""
- target = messaging.Target(version='1.0')
+ target = oslo_messaging.Target(version='1.0')
def __init__(self, host=None):
super(DhcpAgent, self).__init__(host=host)
{'net_id': network.id, 'action': action})
except Exception as e:
self.schedule_resync(e, network.id)
- if (isinstance(e, messaging.RemoteError)
+ if (isinstance(e, oslo_messaging.RemoteError)
and e.exc_type == 'NetworkNotFound'
or isinstance(e, exceptions.NetworkNotFound)):
LOG.warning(_LW("Network %s has been deleted."), network.id)
self.context = context
self.host = cfg.CONF.host
self.use_namespaces = use_namespaces
- target = messaging.Target(
+ target = oslo_messaging.Target(
topic=topic,
namespace=constants.RPC_NAMESPACE_DHCP_PLUGIN,
version='1.0')
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
DHCP_AGENT_OPTS = [
cfg.IntOpt('resync_interval', default=5,
import eventlet
eventlet.monkey_patch()
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.agent.dhcp import config as dhcp_config
import abc
-from oslo.config import cfg
+from oslo_config import cfg
import six
from neutron.common import constants as n_const
import eventlet
import netaddr
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import excutils
-from oslo.utils import importutils
-from oslo.utils import timeutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_utils import excutils
+from oslo_utils import importutils
+from oslo_utils import timeutils
from neutron.agent.common import config
from neutron.agent.l3 import dvr
def __init__(self, topic, host):
self.host = host
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def get_routers(self, context, router_ids=None):
def get_external_network_id(self, context):
"""Make a remote process call to retrieve the external network id.
- @raise messaging.RemoteError: with TooManyExternalNetworks as
- exc_type if there are more than one
- external network
+ @raise oslo_messaging.RemoteError: with TooManyExternalNetworks as
+ exc_type if there are more than one
+ external network
"""
cctxt = self.client.prepare()
return cctxt.call(context, 'get_external_network_id', host=self.host)
- del_arp_entry
Needed by the L3 service when dealing with DVR
"""
- target = messaging.Target(version='1.2')
+ target = oslo_messaging.Target(version='1.2')
def __init__(self, host, conf=None):
if conf:
try:
self.neutron_service_plugins = (
self.plugin_rpc.get_service_plugin_list(self.context))
- except messaging.RemoteError as e:
+ except oslo_messaging.RemoteError as e:
with excutils.save_and_reraise_exception() as ctx:
ctx.reraise = False
LOG.warning(_LW('l3-agent cannot check service plugins '
'UnsupportedVersion you can ignore this '
'warning. Detail message: %s'), e)
self.neutron_service_plugins = None
- except messaging.MessagingTimeout as e:
+ except oslo_messaging.MessagingTimeout as e:
with excutils.save_and_reraise_exception() as ctx:
if retry_count > 0:
ctx.reraise = False
self.target_ex_net_id = self.plugin_rpc.get_external_network_id(
self.context)
return self.target_ex_net_id
- except messaging.RemoteError as e:
+ except oslo_messaging.RemoteError as e:
with excutils.save_and_reraise_exception() as ctx:
if e.exc_type == 'TooManyExternalNetworks':
ctx.reraise = False
routers = self.plugin_rpc.get_routers(context,
[self.conf.router_id])
- except messaging.MessagingException:
+ except oslo_messaging.MessagingException:
LOG.exception(_LE("Failed synchronizing routers due to RPC error"))
else:
LOG.debug('Processing :%r', routers)
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
OPTS = [
import os
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants as l3_constants
from neutron.i18n import _LE
import datetime
import Queue
-from oslo.utils import timeutils
+from oslo_utils import timeutils
# Lower value is higher priority
PRIORITY_RPC = 0
import eventlet
eventlet.monkey_patch()
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.agent.l3 import config as l3_config
import sys
import netaddr
-from oslo.serialization import jsonutils
-from oslo.utils import importutils
+from oslo_serialization import jsonutils
+from oslo_utils import importutils
import six
from neutron.agent.linux import ip_lib
import os.path
import eventlet
-from oslo.config import cfg
from oslo_concurrency import lockutils
+from oslo_config import cfg
from neutron.agent.common import config as agent_cfg
from neutron.agent.linux import ip_lib
"""Handle multiple process managers and watch over all of them.
:param config: oslo config object with the agent configuration.
- :type config: oslo.config.ConfigOpts
+ :type config: oslo_config.ConfigOpts
:param root_helper: root helper to be used with new ProcessManagers
:type root_helper: str
:param resource_type: can be dhcp, router, load_balancer, etc.
import abc
import netaddr
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
import six
from neutron.agent.common import config
import os
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.linux import utils
from neutron.common import exceptions
# under the License.
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent import firewall
from neutron.agent.linux import ipset_manager
import re
import sys
-from oslo.config import cfg
-from oslo.utils import excutils
from oslo_concurrency import lockutils
+from oslo_config import cfg
+from oslo_utils import excutils
from neutron.agent.common import config
from neutron.agent.linux import iptables_comments as ic
import stat
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.linux import external_process
from neutron.agent.linux import utils
import itertools
import operator
-from oslo.config import cfg
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_utils import excutils
import retrying
import six
import itertools
import uuid
-from oslo.serialization import jsonutils
-from oslo.utils import excutils
+from oslo_serialization import jsonutils
+from oslo_utils import excutils
from neutron.agent.linux import utils
from neutron.agent import ovsdb
import jinja2
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
import six
from neutron.agent.linux import utils
from eventlet.green import subprocess
from eventlet import greenthread
-from oslo.utils import excutils
+from oslo_utils import excutils
from neutron.common import constants
from neutron.common import utils
import eventlet
import httplib2
from neutronclient.v2_0 import client
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import excutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_utils import excutils
import six.moves.urllib.parse as urlparse
import webob
"""
def __init__(self, topic):
- target = messaging.Target(topic=topic,
- namespace=n_const.RPC_NAMESPACE_METADATA,
- version='1.0')
+ target = oslo_messaging.Target(
+ topic=topic,
+ namespace=n_const.RPC_NAMESPACE_METADATA,
+ version='1.0')
self.client = n_rpc.get_client(target)
def get_ports(self, context, filters):
if self.use_rpc:
try:
return self.plugin_rpc.get_ports(self.context, filters)
- except (messaging.MessagingException, AttributeError):
+ except (oslo_messaging.MessagingException, AttributeError):
# TODO(obondarev): remove fallback once RPC is proven
# to work fine with metadata agent (K or L release at most)
LOG.warning(_LW('Server does not support metadata RPC, '
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import utils
import os
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.agent.linux import external_process
eventlet.monkey_patch()
import httplib2
-from oslo.config import cfg
+from oslo_config import cfg
import six.moves.urllib.parse as urlparse
import webob
import eventlet
eventlet.monkey_patch()
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config as agent_conf
from neutron.agent.metadata import agent
import abc
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
import six
interface_map = {
# under the License.
import itertools
-from oslo import messaging
-from oslo.utils import timeutils
+import oslo_messaging
+from oslo_utils import timeutils
from neutron.common import rpc as n_rpc
from neutron.common import topics
class PluginReportStateAPI(object):
def __init__(self, topic):
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def report_state(self, context, agent_state, use_call=False):
'''
def __init__(self, topic):
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def get_device_details(self, context, device, agent_id, host=None):
cctxt = self.client.prepare(version='1.3')
res = cctxt.call(context, 'get_devices_details_list',
devices=devices, agent_id=agent_id, host=host)
- except messaging.UnsupportedVersion:
+ except oslo_messaging.UnsupportedVersion:
# If the server has not been upgraded yet, a DVR-enabled agent
# may not work correctly, however it can function in 'degraded'
# mode, in that DVR routers may not be in the system yet, and
import functools
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import importutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_utils import importutils
from neutron.agent import firewall
from neutron.common import constants
doc/source/devref/rpc_api.rst.
"""
def __init__(self, topic):
- target = messaging.Target(topic=topic, version='1.0',
- namespace=constants.RPC_NAMESPACE_SECGROUP)
+ target = oslo_messaging.Target(
+ topic=topic, version='1.0',
+ namespace=constants.RPC_NAMESPACE_SECGROUP)
self.client = n_rpc.get_client(target)
def security_group_rules_for_devices(self, context, devices):
try:
self.plugin_rpc.security_group_info_for_devices(
self.context, devices=[])
- except messaging.UnsupportedVersion:
+ except oslo_messaging.UnsupportedVersion:
LOG.warning(_LW('security_group_info_for_devices rpc call not '
'supported by the server, falling back to old '
'security_group_rules_for_devices which scales '
import urllib
-from oslo.config import cfg
+from oslo_config import cfg
from webob import exc
from neutron.common import constants
import itertools
import os
-from oslo.config import cfg
+from oslo_config import cfg
import routes
import six
import webob.dec
# See the License for the specific language governing permissions and
# limitations under the License.
-from oslo import messaging
+import oslo_messaging
from neutron.common import constants
from neutron.common import rpc as n_rpc
def __init__(self, topic=topics.DHCP_AGENT, plugin=None):
self._plugin = plugin
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
@property
import random
-from oslo import messaging
+import oslo_messaging
from neutron.common import constants
from neutron.common import rpc as n_rpc
"""API for plugin to notify L3 agent."""
def __init__(self, topic=topics.L3_AGENT):
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def _notification_host(self, context, method, payload, host):
# License for the specific language governing permissions and limitations
# under the License.
-from oslo import messaging
+import oslo_messaging
from neutron.common import constants
from neutron.common import rpc as n_rpc
def __init__(self, topic=topics.METERING_AGENT):
self.topic = topic
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def _agent_notification(self, context, method, routers):
import itertools
import operator
-from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo import messaging
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_db import exception as db_exc
+import oslo_messaging
+from oslo_utils import excutils
from neutron.api.v2 import attributes
from neutron.common import constants
# 1.0 - Initial version.
# 1.1 - Added get_active_networks_info, create_dhcp_port,
# and update_dhcp_port methods.
- target = messaging.Target(namespace=constants.RPC_NAMESPACE_DHCP_PLUGIN,
- version='1.1')
+ target = oslo_messaging.Target(
+ namespace=constants.RPC_NAMESPACE_DHCP_PLUGIN,
+ version='1.1')
def _get_active_networks(self, context, **kwargs):
"""Retrieve and return a list of the active networks."""
# License for the specific language governing permissions and limitations
# under the License.
-from oslo import messaging
+import oslo_messaging
from neutron.common import log
from neutron.common import rpc as n_rpc
"""Agent-side RPC (stub) for agent-to-plugin interaction."""
def __init__(self, topic):
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
@log.log
# History
# 1.0 Initial version
- target = messaging.Target(version='1.0')
+ target = oslo_messaging.Target(version='1.0')
@property
def plugin(self):
# See the License for the specific language governing permissions and
# limitations under the License.
-from oslo.config import cfg
-from oslo import messaging
-from oslo.serialization import jsonutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_serialization import jsonutils
from neutron.common import constants
from neutron.common import exceptions
# 1.2 Added methods for DVR support
# 1.3 Added a method that returns the list of activated services
# 1.4 Added L3 HA update_router_state
- target = messaging.Target(version='1.4')
+ target = oslo_messaging.Target(version='1.4')
@property
def plugin(self):
# See the License for the specific language governing permissions and
# limitations under the License.
-from oslo import messaging
+import oslo_messaging
from neutron.common import constants
from neutron import manager
"""
# 1.0 MetadataPluginAPI BASE_RPC_API_VERSION
- target = messaging.Target(version='1.0',
- namespace=constants.RPC_NAMESPACE_METADATA)
+ target = oslo_messaging.Target(version='1.0',
+ namespace=constants.RPC_NAMESPACE_METADATA)
@property
def plugin(self):
# License for the specific language governing permissions and limitations
# under the License.
-from oslo import messaging
+import oslo_messaging
from neutron.common import constants
from neutron import manager
# NOTE: target must not be overridden in subclasses
# to keep RPC API version consistent across plugins.
- target = messaging.Target(version='1.2',
- namespace=constants.RPC_NAMESPACE_SECGROUP)
+ target = oslo_messaging.Target(version='1.2',
+ namespace=constants.RPC_NAMESPACE_SECGROUP)
@property
def plugin(self):
import netaddr
import webob.exc
-from oslo.config import cfg
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_utils import excutils
from neutron.api import api_common
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
import sys
import netaddr
-from oslo import i18n
+import oslo_i18n
import six
import webob.dec
import webob.exc
:returns: the translated object, or the object as-is if it
was not translated
"""
- localize = i18n.translate
+ localize = oslo_i18n.translate
if isinstance(translatable, exceptions.NeutronException):
translatable.msg = localize(translatable.msg, locale)
elif isinstance(translatable, webob.exc.HTTPError):
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.api import extensions
from neutron.api.v2 import base
# See the License for the specific language governing permissions and
# limitations under the License.
-from oslo.config import cfg
+from oslo_config import cfg
import routes as routes_mapper
import six.moves.urllib.parse as urlparse
import webob
# License for the specific language governing permissions and limitations
# under the License.
-from oslo import i18n
+import oslo_i18n
import webob.dec
from neutron.api.views import versions as versions_view
if req.path != '/':
language = req.best_match_language()
msg = _('Unknown API version specified')
- msg = i18n.translate(msg, language)
+ msg = oslo_i18n.translate(msg, language)
return webob.exc.HTTPNotFound(explanation=msg)
builder = versions_view.get_view_builder(req)
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.middleware import request_id
+from oslo_config import cfg
+from oslo_middleware import request_id
import webob.dec
import webob.exc
import eventlet
eventlet.monkey_patch()
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from neutron.agent.common import config as agent_config
from neutron.agent.dhcp import config as dhcp_config
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config as agent_config
from neutron.agent.l3 import config as l3_config
from neutron.common import config
from neutron.i18n import _LE, _LW
from neutron.openstack.common import log as logging
-from oslo.config import cfg
+from oslo_config import cfg
LOG = logging.getLogger(__name__)
import os
import sys
-from oslo.config import cfg
-from oslo.db import options as db_options
-from oslo import messaging
+from oslo_config import cfg
+from oslo_db import options as db_options
+import oslo_messaging
from paste import deploy
from neutron.api.v2 import attributes
cfg.CONF.register_cli_opts(core_cli_opts)
# Ensure that the control exchange is set correctly
-messaging.set_transport_defaults(control_exchange='neutron')
+oslo_messaging.set_transport_defaults(control_exchange='neutron')
_SQL_CONNECTION_DEFAULT = 'sqlite://'
# Update the default QueuePool parameters. These can be tweaked by the
# configuration variables - max_pool_size, max_overflow and pool_timeout
Neutron base exception handling.
"""
-from oslo.utils import excutils
+from oslo_utils import excutils
class NeutronException(Exception):
import importlib
import os
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.openstack.common import log as logging
def alembic_name(self, module):
return self.MODULES[module]['alembic-name']
- # Return an INI parser for the child module. oslo.conf is a bit too
+ # Return an INI parser for the child module. oslo.config is a bit too
# magical in its INI loading, and in one notable case, we need to merge
# together the [service_providers] section across at least four
# repositories.
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo import messaging
-from oslo.messaging import serializer as om_serializer
+from oslo_config import cfg
+import oslo_messaging
+from oslo_messaging import serializer as om_serializer
from neutron.common import exceptions
from neutron import context
def init(conf):
global TRANSPORT, NOTIFIER
exmods = get_allowed_exmods()
- TRANSPORT = messaging.get_transport(conf,
- allowed_remote_exmods=exmods,
- aliases=TRANSPORT_ALIASES)
+ TRANSPORT = oslo_messaging.get_transport(conf,
+ allowed_remote_exmods=exmods,
+ aliases=TRANSPORT_ALIASES)
serializer = RequestContextSerializer()
- NOTIFIER = messaging.Notifier(TRANSPORT, serializer=serializer)
+ NOTIFIER = oslo_messaging.Notifier(TRANSPORT, serializer=serializer)
def cleanup():
def get_client(target, version_cap=None, serializer=None):
assert TRANSPORT is not None
serializer = RequestContextSerializer(serializer)
- return messaging.RPCClient(TRANSPORT,
- target,
- version_cap=version_cap,
- serializer=serializer)
+ return oslo_messaging.RPCClient(TRANSPORT,
+ target,
+ version_cap=version_cap,
+ serializer=serializer)
def get_server(target, endpoints, serializer=None):
assert TRANSPORT is not None
serializer = RequestContextSerializer(serializer)
- return messaging.get_rpc_server(TRANSPORT, target, endpoints,
- 'eventlet', serializer)
+ return oslo_messaging.get_rpc_server(TRANSPORT, target, endpoints,
+ 'eventlet', serializer)
def get_notifier(service=None, host=None, publisher_id=None):
self.servers = []
def create_consumer(self, topic, endpoints, fanout=False):
- target = messaging.Target(
+ target = oslo_messaging.Target(
topic=topic, server=cfg.CONF.host, fanout=fanout)
server = get_server(target, endpoints)
self.servers.append(server)
import uuid
from eventlet.green import subprocess
-from oslo.config import cfg
-from oslo.utils import excutils
from oslo_concurrency import lockutils
+from oslo_config import cfg
+from oslo_utils import excutils
from neutron.common import constants as q_const
from neutron.openstack.common import log as logging
from eventlet import greenthread
-from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo import messaging
-from oslo.serialization import jsonutils
-from oslo.utils import timeutils
+from oslo_config import cfg
+from oslo_db import exception as db_exc
+import oslo_messaging
+from oslo_serialization import jsonutils
+from oslo_utils import timeutils
import sqlalchemy as sa
from sqlalchemy.orm import exc
from sqlalchemy import sql
class AgentExtRpcCallback(object):
"""Processes the rpc report in plugin implementations."""
- target = messaging.Target(version='1.0')
+ target = oslo_messaging.Target(version='1.0')
START_TIME = timeutils.utcnow()
def __init__(self, plugin=None):
import random
import time
-from oslo.config import cfg
-from oslo.utils import timeutils
+from oslo_config import cfg
+from oslo_utils import timeutils
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.orm import exc
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.db.sqlalchemy import session
+from oslo_config import cfg
+from oslo_db.sqlalchemy import session
_FACADE = None
# under the License.
import netaddr
-from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_db import exception as db_exc
+from oslo_utils import excutils
from sqlalchemy import and_
from sqlalchemy import event
from sqlalchemy import orm
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.db import exception as db_exc
+from oslo_db import exception as db_exc
import sqlalchemy as sa
from neutron.i18n import _LE
from neutron import manager
from neutron.openstack.common import log as logging
-from oslo.config import cfg
+from oslo_config import cfg
from sqlalchemy.orm import exc
LOG = logging.getLogger(__name__)
# under the License.
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
import sqlalchemy as sa
from sqlalchemy import orm
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo import messaging
+from oslo_config import cfg
+from oslo_db import exception as db_exc
+import oslo_messaging
import sqlalchemy as sa
from sqlalchemy import func
from sqlalchemy import or_
try:
self.reschedule_router(context, binding.router_id)
except (l3agentscheduler.RouterReschedulingFailed,
- messaging.RemoteError):
+ oslo_messaging.RemoteError):
# Catch individual router rescheduling errors here
# so one broken one doesn't stop the iteration.
LOG.exception(_LE("Failed to reschedule router %s"),
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.api.v2 import attributes
from neutron.common import constants as l3_const
import random
-from oslo.db import exception as db_exc
+from oslo_db import exception as db_exc
import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.orm import exc
#
import netaddr
-from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_db import exception as db_exc
+from oslo_utils import excutils
import sqlalchemy as sa
from sqlalchemy import orm
# License for the specific language governing permissions and limitations
# under the License.
-from oslo import messaging
+import oslo_messaging
from neutron.common import constants as consts
from neutron.common import utils
class MeteringRpcCallbacks(object):
- target = messaging.Target(version='1.0')
+ target = oslo_messaging.Target(version='1.0')
def __init__(self, meter_plugin):
self.meter_plugin = meter_plugin
from logging import config as logging_config
from alembic import context
-from oslo.config import cfg
-from oslo.db.sqlalchemy import session
+from oslo_config import cfg
+from oslo_db.sqlalchemy import session
import sqlalchemy as sa
from sqlalchemy import event
from alembic import environment
from alembic import script as alembic_script
from alembic import util as alembic_util
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from neutron.common import repos
import argparse
-from oslo.db.sqlalchemy import session
+from oslo_db.sqlalchemy import session
import sqlalchemy as sa
from neutron.extensions import portbindings
# See the License for the specific language governing permissions and
# limitations under the License.
-from oslo.db.sqlalchemy import models
+from oslo_db.sqlalchemy import models
from sqlalchemy.ext import declarative
from sqlalchemy import orm
import socket
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.agent.linux import dhcp
import sys
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from neutron.agent.common import config
from neutron.agent.linux import interface
from neutron.api.v2 import attributes as attr
from neutron.common import exceptions as nexception
-from oslo.config import cfg
+from oslo_config import cfg
allowed_address_pair_opts = [
#TODO(limao): use quota framework when it support quota for attributes
import abc
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.api import extensions
from neutron.api.v2 import attributes as attr
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
import webob
from neutron.api import extensions
import abc
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
import six
from neutron.api import extensions
for level, hint in _all_log_levels.iteritems()))
+oslo_namespace_imports_dot = re.compile(r"from[\s]*oslo[.]")
+oslo_namespace_imports_root = re.compile(r"from[\s]*oslo[\s]*import[\s]*")
+
+
def validate_log_translations(logical_line, physical_line, filename):
# Translations are not required in the test directory
if "neutron/tests" in filename:
yield (0, msg)
+def check_oslo_namespace_imports(logical_line, blank_before, filename):
+ if re.match(oslo_namespace_imports_dot, logical_line):
+ msg = ("N323: '%s' must be used instead of '%s'.") % (
+ logical_line.replace('oslo.', 'oslo_'),
+ logical_line)
+ yield(0, msg)
+ elif re.match(oslo_namespace_imports_root, logical_line):
+ msg = ("N323: '%s' must be used instead of '%s'.") % (
+ logical_line.replace('from oslo import ', 'import oslo_'),
+ logical_line)
+ yield(0, msg)
+
+
def factory(register):
register(validate_log_translations)
register(use_jsonutils)
register(check_assert_called_once_with)
register(no_translate_debug_logs)
+ register(check_oslo_namespace_imports)
# License for the specific language governing permissions and limitations
# under the License.
-from oslo import i18n
+import oslo_i18n
-_translators = i18n.TranslatorFactory(domain='neutron')
+_translators = oslo_i18n.TranslatorFactory(domain='neutron')
# The primary translation function using the well-known name "_"
_ = _translators.primary
import weakref
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import importutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_utils import importutils
from neutron.common import utils
from neutron.i18n import _LE, _LI
class Manager(periodic_task.PeriodicTasks):
# Set RPC API version to 1.0 by default.
- target = messaging.Target(version='1.0')
+ target = oslo_messaging.Target(version='1.0')
def __init__(self, host=None):
if not host:
from novaclient import exceptions as nova_exceptions
import novaclient.v1_1.client as nclient
from novaclient.v1_1.contrib import server_external_events
-from oslo.config import cfg
+from oslo_config import cfg
from sqlalchemy.orm import attributes as sql_attr
from neutron.common import constants
import eventlet
eventlet.monkey_patch()
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import excutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_utils import excutils
from neutron.agent.linux import ovs_lib
from neutron.agent.linux import utils
class RestProxyAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin):
- target = messaging.Target(version='1.1')
+ target = oslo_messaging.Target(version='1.1')
def __init__(self, integ_br, polling_interval, root_helper, vs='ovs'):
super(RestProxyAgent, self).__init__()
This module manages configuration options
"""
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config as agconfig
from neutron.common import utils
import string
import time
-from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo.db.sqlalchemy import session
+from oslo_config import cfg
+from oslo_db import exception as db_exc
+from oslo_db.sqlalchemy import session
import sqlalchemy as sa
from neutron.db import model_base
Big Switch core plugin.
"""
-from oslo.config import cfg
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_utils import excutils
from neutron.api import extensions as neutron_extensions
from neutron.common import exceptions
import re
import eventlet
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import importutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_utils import importutils
from sqlalchemy.orm import exc as sqlexc
from neutron.agent import securitygroups_rpc as sg_rpc
def __init__(self, topic):
self.topic = topic
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def port_update(self, context, port):
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
import sqlalchemy as sa
from sqlalchemy import orm
import eventlet
import eventlet.corolocal
-from oslo.config import cfg
-from oslo.serialization import jsonutils
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_serialization import jsonutils
+from oslo_utils import excutils
from neutron.common import exceptions
from neutron.i18n import _LE, _LI, _LW
import re
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from six import moves
from wsgiref import simple_server
"""Implentation of Brocade Neutron Plugin."""
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import importutils
+from oslo_config import cfg
from oslo_context import context as oslo_context
+import oslo_messaging
+from oslo_utils import importutils
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
class BridgeRpcCallbacks(object):
"""Agent callback."""
- target = messaging.Target(version='1.2')
+ target = oslo_messaging.Target(version='1.2')
# Device names start with "tap"
# history
# 1.1 Support Security Group RPC
def __init__(self, topic):
self.topic = topic
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
self.topic_network_delete = topics.get_topic_name(topic,
topics.NETWORK,
"""
from ncclient import manager
-from oslo.utils import excutils
+from oslo_utils import excutils
from neutron.i18n import _LE
from neutron.openstack.common import log as logging
import sys
import time
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import importutils
-from oslo.utils import timeutils
from oslo_concurrency import lockutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_utils import importutils
+from oslo_utils import timeutils
from neutron.agent.common import config
from neutron.agent.linux import external_process
def __init__(self, topic, host):
self.host = host
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def report_dead_hosting_devices(self, context, hd_ids=None):
The main entry points in this class are the `process_services()` and
`_backlog_task()` .
"""
- target = messaging.Target(version='1.1')
+ target = oslo_messaging.Target(version='1.1')
OPTS = [
cfg.IntOpt('rpc_loop_interval', default=10,
import ciscoconfparse
from ncclient import manager
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.i18n import _LE, _LI, _LW
from neutron.plugins.cisco.cfg_agent import cfg_exceptions as cfg_exc
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.utils import excutils
-from oslo.utils import importutils
+from oslo_utils import excutils
+from oslo_utils import importutils
from neutron.i18n import _LE
from neutron.openstack.common import log as logging
import logging
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.plugins.cisco.cfg_agent.device_drivers import devicedriver_api
import datetime
-from oslo.config import cfg
-from oslo.utils import timeutils
+from oslo_config import cfg
+from oslo_utils import timeutils
from neutron.agent.linux import utils as linux_utils
from neutron.i18n import _LI, _LW
import eventlet
import netaddr
-from oslo import messaging
-from oslo.utils import excutils
+import oslo_messaging
+from oslo_utils import excutils
from neutron.common import constants as l3_constants
from neutron.common import rpc as n_rpc
def __init__(self, topic, host):
self.host = host
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def get_routers(self, context, router_ids=None, hd_ids=None):
if device_ids:
return self.plugin_rpc.get_routers(self.context,
hd_ids=device_ids)
- except messaging.MessagingException:
+ except oslo_messaging.MessagingException:
LOG.exception(_LE("RPC Error in fetching routers from plugin"))
self.fullsync = True
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from keystoneclient import exceptions as k_exceptions
from keystoneclient.v2_0 import client as k_client
-from oslo.config import cfg
-from oslo.utils import importutils
-from oslo.utils import timeutils
+from oslo_config import cfg
+from oslo_utils import importutils
+from oslo_utils import timeutils
from sqlalchemy.orm import exc
from sqlalchemy.orm import joinedload
import copy
-from oslo.config import cfg
from oslo_concurrency import lockutils
+from oslo_config import cfg
from sqlalchemy.orm import exc
from sqlalchemy.orm import joinedload
from sqlalchemy.sql import expression as expr
import netaddr
-from oslo.config import cfg
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_utils import excutils
from neutron.i18n import _LE
from neutron import manager
import eventlet
-from oslo.config import cfg
+from oslo_config import cfg
from sqlalchemy.orm import exc
from sqlalchemy.sql import expression as expr
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.common import constants
from neutron.common import utils
# under the License.
#
-from oslo import messaging
+import oslo_messaging
from neutron.common import rpc as n_rpc
from neutron.openstack.common import log as logging
def __init__(self, l3plugin):
self._l3plugin = l3plugin
self.topic = c_constants.CFG_AGENT_L3_ROUTING
- target = messaging.Target(topic=self.topic, version='1.0')
+ target = oslo_messaging.Target(topic=self.topic, version='1.0')
self.client = n_rpc.get_client(target)
def _agent_notification(self, context, method, routers, operation, data):
from novaclient import exceptions as nova_exc
from novaclient import utils as n_utils
from novaclient.v1_1 import client
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.i18n import _LE
from neutron import manager
import inspect
-from oslo.utils import excutils
-from oslo.utils import importutils
+from oslo_utils import excutils
+from oslo_utils import importutils
from neutron.api.v2 import attributes
from neutron.extensions import portbindings
import eventlet
import netaddr
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
import requests
from neutron.common import exceptions as n_exc
import eventlet
-from oslo.config import cfg as q_conf
-from oslo.utils import excutils
-from oslo.utils import importutils
+from oslo_config import cfg as q_conf
+from oslo_utils import excutils
+from oslo_utils import importutils
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.api.rpc.handlers import dhcp_rpc
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.utils import importutils
+from oslo_utils import importutils
import webob.exc as wexc
from neutron.api import extensions as neutron_extensions
# License for the specific language governing permissions and limitations
# under the License.
-from oslo import messaging
+import oslo_messaging
from neutron.common import rpc as n_rpc
from neutron.common import topics
class CiscoRouterPluginRpcCallbacks(l3_router_rpc.L3RouterCfgRpcCallbackMixin,
devices_rpc.DeviceCfgRpcCallbackMixin):
- target = messaging.Target(version='1.1')
+ target = oslo_messaging.Target(version='1.1')
def __init__(self, l3plugin):
super(CiscoRouterPluginRpcCallbacks, self).__init__()
from heleosapi import backend_operations as h_op
from heleosapi import constants as h_con
from heleosapi import exceptions as h_exc
-from oslo.config import cfg
+from oslo_config import cfg
from sqlalchemy.orm import exc
from neutron.common import constants as l3_constants
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
heleos_opts = [
import eventlet
eventlet.monkey_patch()
-from oslo.config import cfg
-from oslo import messaging
+from oslo_config import cfg
+import oslo_messaging
from neutron.agent.common import config
from neutron.agent import rpc as agent_rpc
class HyperVSecurityCallbackMixin(sg_rpc.SecurityGroupAgentRpcCallbackMixin):
- target = messaging.Target(version='1.1')
+ target = oslo_messaging.Target(version='1.1')
def __init__(self, sg_agent):
super(HyperVSecurityCallbackMixin, self).__init__()
class HyperVNeutronAgent(object):
# Set RPC API version to 1.1 by default.
- target = messaging.Target(version='1.1')
+ target = oslo_messaging.Target(version='1.1')
def __init__(self):
super(HyperVNeutronAgent, self).__init__()
import sys
import time
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import exceptions as n_exc
from neutron.openstack.common import log as logging
import sys
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.i18n import _LW
from neutron.openstack.common import log as logging
# License for the specific language governing permissions and limitations
# under the License.
-from oslo import messaging
+import oslo_messaging
from neutron.common import rpc as n_rpc
from neutron.common import topics
self.topic_tunnel_update = topics.get_topic_name(topic,
constants.TUNNEL,
topics.UPDATE)
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def network_delete(self, context, network_id):
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.api.rpc.handlers import dhcp_rpc
from neutron.api.rpc.handlers import l3_rpc
# License for the specific language governing permissions and limitations
# under the License.
-from oslo import messaging
+import oslo_messaging
from neutron.common import constants as q_const
from neutron.openstack.common import log as logging
# history
# 1.1 Support Security Group RPC
# 1.2 Support get_devices_details_list
- target = messaging.Target(version='1.2')
+ target = oslo_messaging.Target(version='1.2')
def __init__(self, notifier):
super(HyperVRpcCallbacks, self).__init__()
import eventlet
eventlet.monkey_patch()
-from oslo.config import cfg
-from oslo import messaging
+from oslo_config import cfg
+import oslo_messaging
from neutron.agent.linux import ip_lib
from neutron.agent.linux import ovs_lib
class SdnveNeutronAgent(object):
- target = messaging.Target(version='1.1')
+ target = oslo_messaging.Target(version='1.1')
def __init__(self, integ_br, interface_mappings,
info, root_helper, polling_interval,
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
DEFAULT_INTERFACE_MAPPINGS = []
import httplib2
from keystoneclient.v2_0 import client as keyclient
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.api.v2 import attributes
from neutron.common import utils
import functools
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import excutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_utils import excutils
from neutron.common import constants as n_const
from neutron.common import exceptions as n_exc
'''Agent side of the SDN-VE rpc API.'''
def __init__(self, topic):
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
self.topic_info_update = topics.get_topic_name(topic,
constants.INFO,
import eventlet
eventlet.monkey_patch()
-from oslo.config import cfg
-from oslo import messaging
+from oslo_config import cfg
+import oslo_messaging
from six import moves
from neutron.agent import l2population_rpc as l2pop_rpc
# Set RPC API version to 1.0 by default.
# history
# 1.1 Support Security Group RPC
- target = messaging.Target(version='1.1')
+ target = oslo_messaging.Target(version='1.1')
def __init__(self, context, agent, sg_agent):
super(LinuxBridgeRpcCallbacks, self).__init__()
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
meta_plugin_opts = [
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from neutron.common import exceptions as exc
from neutron.common import topics
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.db import db_base_plugin_v2
from neutron.db import external_net_db
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from midonet.neutron import plugin
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
ml2_opts = [
from sqlalchemy import or_
from sqlalchemy.orm import exc
-from oslo.db import exception as db_exc
+from oslo_db import exception as db_exc
from neutron.common import constants as n_const
from neutron.db import api as db_api
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.common import constants
from neutron.common import exceptions as exc
import struct
import jsonrpclib
-from oslo.config import cfg
+from oslo_config import cfg
from neutron import context as nctx
from neutron.db import db_base_plugin_v2
# limitations under the License.
-from oslo.config import cfg
+from oslo_config import cfg
# Arista ML2 Mechanism driver specific configuration knobs.
from networking_arista.common import db_lib
from networking_arista.ml2 import arista_ml2
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants as n_const
from neutron.i18n import _LI
"""Implentation of Brocade ML2 Mechanism driver for ML2 Plugin."""
-from oslo.config import cfg
-from oslo.utils import excutils
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import excutils
+from oslo_utils import importutils
from neutron.i18n import _LE, _LI
from neutron.openstack.common import log as logging
"""
from ncclient import manager
-from oslo.utils import excutils
+from oslo_utils import excutils
from xml.etree import ElementTree
from neutron.i18n import _LE
eventlet.monkey_patch()
-from oslo.config import cfg
-from oslo import messaging
from oslo_concurrency import lockutils
+from oslo_config import cfg
+import oslo_messaging
from neutron.agent.common import config
from neutron.agent.linux import ip_lib
class ApicTopologyService(manager.Manager):
- target = messaging.Target(version='1.1')
+ target = oslo_messaging.Target(version='1.1')
def __init__(self, host=None):
if host is None:
class ApicTopologyServiceNotifierApi(object):
def __init__(self):
- target = messaging.Target(topic=TOPIC_APIC_SERVICE, version='1.0')
+ target = oslo_messaging.Target(topic=TOPIC_APIC_SERVICE, version='1.0')
self.client = rpc.get_client(target)
def update_link(self, context, host, interface, mac, switch, module, port):
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
DEFAULT_ROOT_HELPER = ('sudo /usr/local/bin/neutron-rootwrap '
'/etc/neutron/rootwrap.conf')
-# oslo.config limits ${var} expansion to global variables
+# oslo_config limits ${var} expansion to global variables
# That is why apic_system_id as a global variable
global_opts = [
cfg.StrOpt('apic_system_id',
from apicapi import apic_manager
from keystoneclient.v2_0 import client as keyclient
import netaddr
-from oslo.config import cfg
from oslo_concurrency import lockutils
+from oslo_config import cfg
from neutron.common import constants as n_constants
from neutron.openstack.common import log
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
ml2_cisco_opts = [
ML2 Mechanism Driver for Cisco Nexus platforms.
"""
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants as n_const
from neutron.extensions import portbindings
Implements a Nexus-OS NETCONF over SSHv2 API Client
"""
-from oslo.utils import excutils
-from oslo.utils import importutils
+from oslo_utils import excutils
+from oslo_utils import importutils
from neutron.openstack.common import log as logging
from neutron.plugins.ml2.drivers.cisco.nexus import config as conf
# limitations under the License.
from neutronclient.v2_0 import client
-from oslo.config import cfg
+from oslo_config import cfg
# Freescale CRD Server Configuration used by ML2 Mechanism Driver.
#
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.db import exception as db_exc
+from oslo_db import exception as db_exc
from neutron.common import exceptions as exc
from neutron.i18n import _LW
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
l2_population_options = [
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.serialization import jsonutils
-from oslo.utils import timeutils
+from oslo_serialization import jsonutils
+from oslo_utils import timeutils
from sqlalchemy import sql
from neutron.common import constants as const
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants as const
from neutron import context as n_context
import collections
import copy
-from oslo import messaging
+import oslo_messaging
from neutron.common import rpc as n_rpc
from neutron.common import topics
self.topic_l2pop_update = topics.get_topic_name(topic,
topics.L2POPULATION,
topics.UPDATE)
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def _notification_fanout(self, context, method, fdb_entries):
import httplib
import eventlet
-from oslo.config import cfg
-from oslo.utils import excutils
-from oslo.utils import timeutils
+from oslo_config import cfg
+from oslo_utils import excutils
+from oslo_utils import timeutils
from neutron import context as ctx
from neutron.extensions import portbindings
# under the License.
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants as n_consts
from neutron.extensions import portbindings
# limitations under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants
from neutron.extensions import portbindings
import re
-from oslo.config import cfg
-from oslo.serialization import jsonutils
+from oslo_config import cfg
+from oslo_serialization import jsonutils
import requests
from neutron.openstack.common import log
# See the License for the specific language governing permissions and
# limitations under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.extensions import portbindings
# limitations under the License.
from networking_mlnx.plugins.ml2.drivers.mlnx import constants
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants as n_const
from neutron.extensions import portbindings
from networking_odl.common import constants as odl_const
from networking_odl.ml2 import mech_driver
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants as n_const
from neutron.extensions import portbindings
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.db import exception as db_exc
+from oslo_config import cfg
+from oslo_db import exception as db_exc
import sqlalchemy as sa
from neutron.common import exceptions as exc
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.db import exception as db_exc
+from oslo_config import cfg
+from oslo_db import exception as db_exc
from six import moves
import sqlalchemy as sa
from sqlalchemy import sql
import sys
-from oslo.config import cfg
+from oslo_config import cfg
from six import moves
import sqlalchemy as sa
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.db import exception as db_exc
+from oslo_config import cfg
+from oslo_db import exception as db_exc
from six import moves
import sqlalchemy as sa
from sqlalchemy import sql
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
import stevedore
from neutron.api.v2 import attributes
import contextlib
from eventlet import greenthread
-from oslo.config import cfg
-from oslo.db import exception as os_db_exception
-from oslo.serialization import jsonutils
-from oslo.utils import excutils
-from oslo.utils import importutils
from oslo_concurrency import lockutils
+from oslo_config import cfg
+from oslo_db import exception as os_db_exception
+from oslo_serialization import jsonutils
+from oslo_utils import excutils
+from oslo_utils import importutils
from sqlalchemy import exc as sql_exc
from sqlalchemy.orm import exc as sa_exc
# License for the specific language governing permissions and limitations
# under the License.
-from oslo import messaging
+import oslo_messaging
from sqlalchemy.orm import exc
from neutron.agent import securitygroups_rpc as sg_rpc
# 1.3 get_device_details rpc signature upgrade to obtain 'host' and
# return value to include fixed_ips and device_owner for
# the device port
- target = messaging.Target(version='1.3')
+ target = oslo_messaging.Target(version='1.3')
def __init__(self, notifier, type_manager):
self.setup_tunnel_callback_mixin(notifier, type_manager)
self.topic_port_update = topics.get_topic_name(topic,
topics.PORT,
topics.UPDATE)
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def network_delete(self, context, network_id):
# limitations under the License.
from networking_mlnx.plugins.mlnx.agent import constants
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
import sys
from networking_mlnx.plugins.mlnx.agent import mlnx_eswitch_neutron_agent
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.i18n import _LE, _LI
from neutron.common import config as common_config
import eventlet
eventlet.monkey_patch()
-from oslo import messaging
+import oslo_messaging
from neutron.agent.linux import ovs_lib
from neutron.agent import rpc as agent_rpc
class NECAgentRpcCallback(object):
- target = messaging.Target(version='1.0')
+ target = oslo_messaging.Target(version='1.0')
def __init__(self, context, agent, sg_agent):
super(NECAgentRpcCallback, self).__init__()
class SecurityGroupAgentRpcCallback(sg_rpc.SecurityGroupAgentRpcCallbackMixin):
- target = messaging.Target(version=sg_rpc.SG_RPC_VERSION)
+ target = oslo_messaging.Target(version=sg_rpc.SG_RPC_VERSION)
def __init__(self, context, sg_agent):
super(SecurityGroupAgentRpcCallback, self).__init__()
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.plugins.nec.common import constants as nconst
import time
-from oslo.serialization import jsonutils
-from oslo.utils import excutils
+from oslo_serialization import jsonutils
+from oslo_utils import excutils
import requests
from neutron.i18n import _LI, _LW
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.utils import importutils
+from oslo_utils import importutils
from neutron.i18n import _LI
from neutron.openstack.common import log as logging
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.api import extensions
from neutron.api.v2 import attributes
# License for the specific language governing permissions and limitations
# under the License.
-from oslo import messaging
-from oslo.utils import excutils
-from oslo.utils import importutils
+import oslo_messaging
+from oslo_utils import excutils
+from oslo_utils import importutils
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.api import extensions as neutron_extensions
self.topic = topic
self.topic_port_update = topics.get_topic_name(
topic, topics.PORT, topics.UPDATE)
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def port_update(self, context, port):
class NECPluginV2RPCCallbacks(object):
- target = messaging.Target(version='1.0')
+ target = oslo_messaging.Target(version='1.0')
def __init__(self, plugin):
super(NECPluginV2RPCCallbacks, self).__init__()
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.utils import excutils
-from oslo.utils import importutils
+from oslo_utils import excutils
+from oslo_utils import importutils
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.v2 import attributes as attr
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.utils import excutils
+from oslo_utils import excutils
from neutron.i18n import _LE
from neutron.openstack.common import log as logging
import abc
import httplib
-from oslo.utils import excutils
+from oslo_utils import excutils
import six
from neutron.common import log as call_log
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
restproxy_opts = [
import re
import netaddr
-from oslo.config import cfg
-from oslo.utils import excutils
-from oslo.utils import importutils
from oslo_concurrency import lockutils
+from oslo_config import cfg
+from oslo_utils import excutils
+from oslo_utils import importutils
from sqlalchemy.orm import exc
from neutron.api import extensions as neutron_extensions
# under the License.
#
-from oslo.config import cfg
-from oslo.utils import importutils
from oslo_concurrency import lockutils
+from oslo_config import cfg
+from oslo_utils import importutils
import sqlalchemy.orm.exc as db_exc
from neutron import context as ncontext
import sys
-from oslo.config import cfg
+from oslo_config import cfg
from ryu.base.app_manager import AppManager
from ryu import cfg as ryu_cfg
import time
import netaddr
-from oslo.config import cfg
-from oslo import messaging
+from oslo_config import cfg
+import oslo_messaging
from ryu.app.ofctl import api as ryu_api
from ryu.base import app_manager
from ryu.controller import handler
# history
# 1.0 Initial version
# 1.1 Support Security Group RPC
- target = messaging.Target(version='1.1')
+ target = oslo_messaging.Target(version='1.1')
def __init__(self, ryuapp, integ_br, local_ip,
bridge_mappings, interface_mappings, root_helper,
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.plugins.openvswitch.common import config as ovs_config
import eventlet
eventlet.monkey_patch()
-from oslo import messaging
+import oslo_messaging
from neutron.agent.linux import ovs_lib
from neutron.agent import rpc as agent_rpc
class NVSDAgentRpcCallback(object):
- target = messaging.Target(version='1.0')
+ target = oslo_messaging.Target(version='1.0')
def __init__(self, context, agent, sg_agent):
super(NVSDAgentRpcCallback, self).__init__()
class SecurityGroupAgentRpcCallback(sg_rpc.SecurityGroupAgentRpcCallbackMixin):
- target = messaging.Target(version=sg_rpc.SG_RPC_VERSION)
+ target = oslo_messaging.Target(version=sg_rpc.SG_RPC_VERSION)
def __init__(self, context, sg_agent):
super(SecurityGroupAgentRpcCallback, self).__init__()
# history
# 1.0 Initial version
# 1.1 Support Security Group RPC
- target = messaging.Target(version='1.1')
+ target = oslo_messaging.Target(version='1.1')
def __init__(self, integ_br, root_helper, polling_interval):
super(NVSDNeutronAgent, self).__init__()
""" Register the configuration options"""
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
"""Intermidiate NVSD Library."""
-from oslo.serialization import jsonutils
-from oslo.utils import excutils
+from oslo_serialization import jsonutils
+from oslo_utils import excutils
from neutron.openstack.common import log as logging
import neutron.plugins.oneconvergence.lib.exception as nvsdexception
import httplib
import time
-from oslo.config import cfg
-from oslo.serialization import jsonutils
+from oslo_config import cfg
+from oslo_serialization import jsonutils
import requests
from six.moves.urllib import parse
"""Implementation of OneConvergence Neutron Plugin."""
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import excutils
-from oslo.utils import importutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_utils import excutils
+from oslo_utils import importutils
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
self.topic = topic
self.topic_port_update = topics.get_topic_name(topic, topics.PORT,
topics.UPDATE)
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def port_update(self, context, port):
# under the License.
#
-from oslo.config import cfg
-from oslo.serialization import jsonutils
+from oslo_config import cfg
+from oslo_serialization import jsonutils
import requests
from neutron.api.v2 import attributes as attr
# under the License.
-from oslo import messaging
-from oslo.utils import excutils
+import oslo_messaging
+from oslo_utils import excutils
from neutron.api.rpc.handlers import dvr_rpc
from neutron.common import constants as n_const
def get_dvr_mac_address(self):
try:
self.get_dvr_mac_address_with_retry()
- except messaging.RemoteError as e:
+ except oslo_messaging.RemoteError as e:
LOG.warning(_LW('L2 agent could not get DVR MAC address at '
'startup due to RPC error. It happens when the '
'server does not support this RPC API. Detailed '
'message: %s'), e)
- except messaging.MessagingTimeout:
+ except oslo_messaging.MessagingTimeout:
LOG.error(_LE('DVR: Failed to obtain a valid local '
'DVR MAC address - L2 Agent operating '
'in Non-DVR Mode'))
try:
details = self.plugin_rpc.get_dvr_mac_address_by_host(
self.context, self.host)
- except messaging.MessagingTimeout as e:
+ except oslo_messaging.MessagingTimeout as e:
with excutils.save_and_reraise_exception() as ctx:
if retry_count > 0:
ctx.reraise = False
import netaddr
from neutron.plugins.openvswitch.agent import ovs_dvr_neutron_agent
-from oslo.config import cfg
-from oslo import messaging
+from oslo_config import cfg
+import oslo_messaging
from six import moves
from neutron.agent import l2population_rpc
# 1.0 Initial version
# 1.1 Support Security Group RPC
# 1.2 Support DVR (Distributed Virtual Router) RPC
- target = messaging.Target(version='1.2')
+ target = oslo_messaging.Target(version='1.2')
def __init__(self, integ_br, tun_br, local_ip,
bridge_mappings, root_helper,
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.plugins.common import constants as p_const
"""
import netaddr
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from sqlalchemy.orm import exc as sa_exc
from neutron.api.v2 import attributes
# limitations under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
import eventlet
eventlet.monkey_patch()
-from oslo.config import cfg
-from oslo import messaging
+from oslo_config import cfg
+import oslo_messaging
from neutron.agent import rpc as agent_rpc
from neutron.agent import securitygroups_rpc as sg_rpc
# Set RPC API version to 1.0 by default.
# history
# 1.1 Support Security Group RPC
- target = messaging.Target(version='1.1')
+ target = oslo_messaging.Target(version='1.1')
def __init__(self, context, agent, sg_agent):
super(SriovNicSwitchRpcCallbacks, self).__init__()
import six
import time
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.i18n import _LE, _LI, _LW
from neutron.openstack.common import log as logging
import urllib
import eventlet
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.i18n import _LI, _LW
from neutron.openstack.common import log as logging
import time
import eventlet
-from oslo.utils import excutils
+from oslo_utils import excutils
import six
import six.moves.urllib.parse as urlparse
import sys
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import config
from neutron.plugins.vmware.common import config as nsx_config # noqa
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.plugins.vmware.common import exceptions as nsx_exc
import random
-from oslo.serialization import jsonutils
-from oslo.utils import timeutils
+from oslo_serialization import jsonutils
+from oslo_utils import timeutils
from neutron.common import constants
from neutron.common import exceptions
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.db import exception as db_exc
-from oslo.utils import excutils
+from oslo_db import exception as db_exc
+from oslo_utils import excutils
from sqlalchemy.orm import exc
import neutron.db.api as db
# under the License.
#
-from oslo.db import exception as d_exc
+from oslo_db import exception as d_exc
from sqlalchemy import orm
from neutron.openstack.common import log as logging
# under the License.
#
-from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_db import exception as db_exc
+from oslo_utils import excutils
from neutron.common import exceptions as n_exc
from neutron.i18n import _LE, _LW
# under the License.
#
-from oslo.config import cfg
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_utils import excutils
from neutron.api.v2 import attributes as attr
from neutron.common import constants as const
from eventlet import greenthread
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.api.v2 import attributes
# under the License.
#
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.api.rpc.handlers import dhcp_rpc
import abc
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.api.v2 import attributes
from neutron.api.v2 import resource_helper
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.i18n import _LI
from neutron.openstack.common import log as logging
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.common import exceptions as exception
from neutron.openstack.common import log
# under the License.
#
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.openstack.common import log
from neutron.plugins.vmware.api_client import exception as api_exc
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.common import exceptions as exception
from neutron.openstack.common import log
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.serialization import jsonutils
-from oslo.utils import excutils
+from oslo_serialization import jsonutils
+from oslo_utils import excutils
from neutron.api.v2 import attributes as attr
from neutron.common import exceptions as exception
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.serialization import jsonutils
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_serialization import jsonutils
+from oslo_utils import excutils
from neutron.common import exceptions as exception
from neutron.i18n import _LE, _LI, _LW
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.serialization import jsonutils
-from oslo.utils import excutils
+from oslo_serialization import jsonutils
+from oslo_utils import excutils
from neutron.common import constants
from neutron.common import exceptions
# under the License.
#
-from oslo.config import cfg
-from oslo.serialization import jsonutils
+from oslo_config import cfg
+from oslo_serialization import jsonutils
from neutron.common import constants
from neutron.common import exceptions as exception
import uuid
-from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo.utils import excutils
from oslo_concurrency import lockutils
+from oslo_config import cfg
+from oslo_db import exception as db_exc
+from oslo_utils import excutils
from sqlalchemy import exc as sql_exc
from sqlalchemy.orm import exc as sa_exc
import webob.exc
import base64
import eventlet
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.plugins.vmware.vshield.common import exceptions
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.serialization import jsonutils
-from oslo.utils import excutils
+from oslo_serialization import jsonutils
+from oslo_utils import excutils
from neutron.i18n import _LE
from neutron.openstack.common import log as logging
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.openstack.common import log as logging
from neutron.plugins.vmware.vshield.common import VcnsApiClient
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.openstack.common import log as logging
from neutron.plugins.vmware.common import config # noqa
import logging
import re
-from oslo.config import cfg
-from oslo.utils import excutils
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import excutils
+from oslo_utils import importutils
from neutron.api.v2 import attributes
from neutron.common import constants as const
import sys
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
import webob
from neutron.common import exceptions
import random
-from oslo.config import cfg
-from oslo.db import exception as db_exc
+from oslo_config import cfg
+from oslo_db import exception as db_exc
from sqlalchemy import sql
from neutron.common import constants
import itertools
import random
-from oslo.config import cfg
-from oslo.db import exception as db_exc
+from oslo_config import cfg
+from oslo_db import exception as db_exc
import six
from sqlalchemy import sql
import eventlet
eventlet.monkey_patch()
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import config
from neutron.i18n import _LI
import os
import random
-from oslo.config import cfg
-from oslo.messaging import server as rpc_server
-from oslo.utils import excutils
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_messaging import server as rpc_server
+from oslo_utils import excutils
+from oslo_utils import importutils
from neutron.common import config
from neutron.common import rpc as n_rpc
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo import messaging
+from oslo_config import cfg
+import oslo_messaging
from neutron.common import rpc as n_rpc
from neutron.openstack.common import log as logging
def __init__(self, topic, host):
self.host = host
- target = messaging.Target(topic=topic, version='1.0')
+ target = oslo_messaging.Target(topic=topic, version='1.0')
self.client = n_rpc.get_client(target)
def set_firewall_status(self, context, firewall_id, status):
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from neutron.agent.common import config
from neutron.agent.linux import ip_lib
"""Implentation of Brocade SVI service Plugin."""
-from oslo.config import cfg
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_utils import excutils
from neutron.common import constants as l3_constants
from neutron.i18n import _LE, _LI
# under the License.
from apicapi import apic_mapper
-from oslo.utils import excutils
+from oslo_utils import excutils
from neutron.db import db_base_plugin_v2
from neutron.db import extraroute_db
import copy
import threading
-from oslo.config import cfg
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_utils import excutils
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.rpc.handlers import l3_rpc
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.rpc.handlers import l3_rpc
import eventlet
eventlet.monkey_patch()
-from oslo.config import cfg
-from oslo import messaging
-from oslo.utils import importutils
+from oslo_config import cfg
+import oslo_messaging
+from oslo_utils import importutils
from neutron.agent.common import config
from neutron.agent import rpc as agent_rpc
# it's actually necessary to initialize parent classes of
# manager.Manager correctly.
super(MeteringPluginRpc, self).__init__()
- target = messaging.Target(topic=topics.METERING_PLUGIN, version='1.0')
+ target = oslo_messaging.Target(topic=topics.METERING_PLUGIN,
+ version='1.0')
self.client = n_rpc.get_client(target)
def _get_sync_data_metering(self, context):
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
import six
from neutron.agent.common import config
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
import stevedore
from neutron.common import exceptions as n_exc
import abc
-from oslo.utils import excutils
-from oslo.utils import importutils
+from oslo_utils import excutils
+from oslo_utils import importutils
import six
from neutron.api import extensions
import os.path
import fixtures
-from oslo.config import cfg
-from oslo.messaging import conffixture as messaging_conffixture
from oslo_concurrency.fixture import lockutils
+from oslo_config import cfg
+from oslo_messaging import conffixture as messaging_conffixture
from neutron.common import config
from neutron.common import rpc as n_rpc
fake_consume_in_threads))
self.useFixture(fixtures.MonkeyPatch(
- 'oslo.messaging.Notifier', fake_notifier.FakeNotifier))
+ 'oslo_messaging.Notifier', fake_notifier.FakeNotifier))
self.messaging_conf = messaging_conffixture.ConfFixture(CONF)
self.messaging_conf.transport_driver = 'fake'
# under the License.
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.agent.linux import ip_lib
# under the License.
import eventlet
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.linux import daemon
import collections
import netaddr
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from neutron.agent.common import config
from neutron.agent.linux import interface
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.agent.linux import external_process
# under the License.
import eventlet
-from oslo.config import cfg
+from oslo_config import cfg
from six import moves
from neutron.agent.linux import external_process
import mock
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
import webob
import webob.dec
import webob.exc
import os
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.tests import base
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
-from oslo.db.sqlalchemy import session
-from oslo.db.sqlalchemy import test_base
+from oslo_config import cfg
+from oslo_db.sqlalchemy import session
+from oslo_db.sqlalchemy import test_base
import testtools
from neutron.api.v2 import attributes
import alembic.migration
from alembic import script as alembic_script
import mock
-from oslo.config import cfg
-from oslo.config import fixture as config_fixture
-from oslo.db.sqlalchemy import test_base
-from oslo.db.sqlalchemy import test_migrations
+from oslo_config import cfg
+from oslo_config import fixture as config_fixture
+from oslo_db.sqlalchemy import test_base
+from oslo_db.sqlalchemy import test_migrations
import sqlalchemy
from neutron.db.migration import cli as migration
import eventlet.timeout
import fixtures
import mock
-from oslo.utils import strutils
+from oslo_utils import strutils
import testtools
from neutron.tests import post_mortem_debug
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
cfg.CONF.use_stderr = False
import contextlib
import httplib
-from oslo.config import cfg
+from oslo_config import cfg
from webob import exc
from neutron import context
import collections
import mock
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
import testtools
from neutron.agent.linux import ovs_lib
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config as agent_config
from neutron.agent.l3 import config as l3_config
import datetime
import mock
-from oslo.utils import timeutils
+from oslo_utils import timeutils
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
from neutron.common import utils
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.openstack.common import log as logging
from neutron.plugins.bigswitch import servermanager
import os
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import neutron.common.test_lib as test_lib
from neutron.plugins.bigswitch import config
import contextlib
import mock
-from oslo.utils import importutils
+from oslo_utils import importutils
from neutron.tests import base
import contextlib
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import webob.exc
from neutron.common import constants
import copy
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from six import moves
from webob import exc
import ssl
import mock
-from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo.serialization import jsonutils
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_db import exception as db_exc
+from oslo_serialization import jsonutils
+from oslo_utils import importutils
from neutron import context
from neutron import manager
import ssl
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import webob.exc
from neutron.openstack.common import log as logging
import mock
-from oslo.utils import importutils
+from oslo_utils import importutils
from neutron.extensions import portbindings
from neutron.plugins.brocade import NeutronPlugin as brocade_plugin
# under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import testtools
from neutron.agent.common import config
import copy
import mock
-from oslo.config import cfg
-from oslo import messaging
+from oslo_config import cfg
+import oslo_messaging
from neutron.common import config as base_config
from neutron.common import constants as l3_constants
@mock.patch("eventlet.GreenPool.spawn_n")
def test_process_services_with_rpc_error(self, mock_spawn):
router, port = prepare_router_data()
- self.plugin_api.get_routers.side_effect = messaging.MessagingException
+ get_routers = self.plugin_api.get_routers
+ get_routers.side_effect = oslo_messaging.MessagingException
self.routing_helper.fullsync = False
self.routing_helper.updated_routers.add(router['id'])
self.routing_helper.process_service()
- self.assertEqual(1, self.plugin_api.get_routers.call_count)
- self.plugin_api.get_routers.assert_called_with(
+ self.assertEqual(1, get_routers.call_count)
+ get_routers.assert_called_with(
self.routing_helper.context,
router_ids=[router['id']])
self.assertFalse(mock_spawn.called)
import mock
from novaclient import exceptions as nova_exc
-from oslo.config import cfg
-from oslo.utils import excutils
+from oslo_config import cfg
+from oslo_utils import excutils
from neutron import context as n_context
from neutron.i18n import _LE
# under the License.
import mock
-from oslo.config import cfg
-from oslo.utils import timeutils
+from oslo_config import cfg
+from oslo_utils import timeutils
from webob import exc
import neutron
import datetime
import mock
-from oslo.db import exception as exc
-from oslo.utils import timeutils
+from oslo_db import exception as exc
+from oslo_utils import timeutils
import testscenarios
from neutron.common import constants
# limitations under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron import context
from neutron.db import dvr_mac_db
# under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants
from neutron import context
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.plugins.embrane.common import config # noqa
from neutron.tests.unit import test_extension_extraroute as extraroute_test
import sys
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.plugins.embrane.common import config # noqa
from neutron.tests.unit import test_db_plugin as test_plugin
import abc
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.api import extensions
from neutron import wsgi
"""
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.plugins.hyperv.agent import hyperv_neutron_agent
from neutron.plugins.hyperv.agent import utilsfactory
import contextlib
-from oslo.config import cfg
+from oslo_config import cfg
from neutron import context
from neutron.extensions import portbindings
"""
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.plugins.hyperv.agent import security_groups_driver as sg_driver
from neutron.plugins.hyperv.agent import utilsfactory
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.plugins.hyperv.agent import utils
from neutron.plugins.hyperv.agent import utilsfactory
import contextlib
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.linux import ip_lib
from neutron.plugins.ibm.agent import sdnve_neutron_agent
import os
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.linux import ip_lib
from neutron.agent.linux import utils
# under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import testtools
from neutron.common import exceptions as exc
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.plugins.ml2.drivers.arista import arista_l3_driver as arista
from neutron.tests import base
#
import mock
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
from oslo_context import context as oslo_context
+from oslo_utils import importutils
from neutron.db import api as db
from neutron.openstack.common import log as logging
# limitations under the License.
import mock
-from oslo.utils import importutils
+from oslo_utils import importutils
from neutron.openstack.common import log as logging
from neutron.plugins.ml2 import config as ml2_config
import requests
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.tests import base
# limitations under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.plugins.ml2.drivers.cisco.nexus import config as cisco_config
from neutron.tests import base
import collections
import mock
-from oslo.utils import importutils
+from oslo_utils import importutils
import testtools
from neutron.common import constants as n_const
# limitations under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.extensions import portbindings
from neutron.plugins.ml2.drivers.freescale import mechanism_fslsdn
# limitations under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import testtools
from neutron.common import constants
import functools
import mock
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron import context as neutron_context
from neutron.extensions import portbindings
import contextlib
import mock
-from oslo.utils import timeutils
+from oslo_utils import timeutils
from neutron.agent import l2population_rpc
from neutron.common import constants
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants
from neutron.extensions import portbindings
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants
from neutron.extensions import portbindings
from neutron.plugins.ml2 import driver_api as api
from neutron.plugins.ml2.drivers import type_flat
from neutron.tests.unit import testlib_api
-from oslo.config import cfg
+from oslo_config import cfg
FLAT_NETWORKS = ['flat_net1', 'flat_net2']
from neutron.plugins.ml2 import driver_api as api
from neutron.plugins.ml2.drivers import type_vlan
from neutron.tests.unit import testlib_api
-from oslo.config import cfg
+from oslo_config import cfg
PROVIDER_NET = 'phys_net1'
TENANT_NET = 'phys_net2'
import time
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from six import moves
import testtools
# under the License.
import mock
-from oslo.config import cfg
-from oslo.serialization import jsonutils
+from oslo_config import cfg
+from oslo_serialization import jsonutils
import requests
from neutron.plugins.nec.common import config
import mock
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants
from neutron.openstack.common import uuidutils
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from testtools import matchers
from webob import exc
from novaclient import exceptions as nova_exceptions
from sqlalchemy.orm import attributes as sql_attr
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants
from neutron.db import models_v2
import mock
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
from webob import exc
from neutron.common import constants
# under the License.
import mock
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from neutron.tests import base
from neutron.tests.unit.ofagent import fake_oflib
import copy
import mock
-from oslo.utils import importutils
+from oslo_utils import importutils
import neutron.plugins.ofagent.agent.metadata as meta
from neutron.tests.unit.ofagent import ofa_test_base
import mock
-from oslo.utils import importutils
+from oslo_utils import importutils
import neutron.plugins.ofagent.agent.metadata as meta
from neutron.tests.unit.ofagent import ofa_test_base
import mock
import netaddr
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
import testtools
from neutron.agent.linux import ovs_lib
import mock
-from oslo.utils import importutils
+from oslo_utils import importutils
from neutron.tests.unit.ofagent import ofa_test_base
import time
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import testtools
from neutron.agent.linux import ovs_lib
import uuid
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron import context
from neutron.extensions import portbindings
#
import mock
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.plugins.oneconvergence.lib import nvsdlib
from neutron.tests import base
# under the License.
import mock
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
import requests
from neutron.plugins.oneconvergence.lib import config # noqa
import mock
import netaddr
-from oslo.config import cfg
-from oslo.serialization import jsonutils
+from oslo_config import cfg
+from oslo_serialization import jsonutils
from testtools import matchers
import webob.exc
import datetime
import mock
-from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo import messaging
-from oslo.utils import timeutils
+from oslo_config import cfg
+from oslo_db import exception as db_exc
+import oslo_messaging
+from oslo_utils import timeutils
from webob import exc
from neutron.api import extensions
mock.patch.object(
plugin, 'reschedule_router',
side_effect=[
- db_exc.DBError(), messaging.RemoteError(),
+ db_exc.DBError(), oslo_messaging.RemoteError(),
l3agentscheduler.RouterReschedulingFailed(router_id='f',
agent_id='f'),
ValueError('this raises')
import contextlib
import mock
-from oslo.config import cfg
-from oslo import messaging
+from oslo_config import cfg
+import oslo_messaging
from neutron.agent.linux import utils
from neutron.common import constants as n_const
with contextlib.nested(
mock.patch.object(self.agent.dvr_agent.plugin_rpc,
'get_dvr_mac_address_by_host',
- side_effect=messaging.RemoteError),
+ side_effect=oslo_messaging.RemoteError),
mock.patch.object(self.agent.dvr_agent.int_br,
'add_flow')) as (gd_mac, add_int_flow_fn):
def test_get_dvr_mac_address_retried(self):
valid_entry = {'host': 'cn1', 'mac_address': 'aa:22:33:44:55:66'}
- raise_timeout = messaging.MessagingTimeout()
+ raise_timeout = oslo_messaging.MessagingTimeout()
# Raise a timeout the first 2 times it calls get_dvr_mac_address()
self._setup_for_dvr_test()
self.agent.dvr_agent.dvr_mac_address = None
get_dvr_mac_address_by_host.call_count, 3)
def test_get_dvr_mac_address_retried_max(self):
- raise_timeout = messaging.MessagingTimeout()
+ raise_timeout = oslo_messaging.MessagingTimeout()
# Raise a timeout every time until we give up, currently 5 tries
self._setup_for_dvr_test()
self.agent.dvr_agent.dvr_mac_address = None
import mock
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
import testtools
from neutron.agent.linux import async_process
import time
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.linux import ip_lib
from neutron.agent.linux import ovs_lib
"""
import mock
-from oslo.utils import importutils
+from oslo_utils import importutils
from neutron.plugins.plumgrid.plumgrid_plugin import plumgrid_plugin
from neutron.tests.unit import test_extension_security_group as ext_sg
"""
import mock
-from oslo.utils import importutils
+from oslo_utils import importutils
from neutron import context
from neutron.extensions import portbindings
'add_router_interface').start()
mock.patch('neutron.db.l3_dvr_db.L3_NAT_with_dvr_db_mixin.'
'remove_router_interface').start()
- mock.patch('oslo.utils.excutils.save_and_reraise_exception').start()
+ mock.patch('oslo_utils.excutils.save_and_reraise_exception').start()
def _test_add_router_interface(self, interface_info):
mgr = self.plugin.manager
import copy
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.services.metering.drivers.iptables import iptables_driver
from neutron.tests import base
# under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.openstack.common import uuidutils
# under the License.
import mock
-from oslo.utils import timeutils
+from oslo_utils import timeutils
from neutron.api.v2 import attributes as attr
from neutron.common import constants as n_constants
# limitations under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import utils as q_utils
from neutron.plugins.sriovnicagent.common import config
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.plugins.sriovnicagent.common import config # noqa
from neutron.plugins.sriovnicagent import sriov_nic_agent
import copy
import time
-from oslo.config import cfg
-from oslo.utils import timeutils
+from oslo_config import cfg
+from oslo_utils import timeutils
from webob import exc
from neutron.api.v2 import attributes
import contextlib
import mock
-from oslo import messaging
from oslo_context import context as oslo_context
+import oslo_messaging
from neutron.agent import rpc
from neutron.tests import base
mock_call, mock_prepare
):
mock_prepare.return_value = agent.client
- mock_call.side_effect = [messaging.UnsupportedVersion('1.2'),
+ mock_call.side_effect = [oslo_messaging.UnsupportedVersion('1.2'),
expect_val_get_device_details]
func_obj = getattr(agent, 'get_devices_details_list')
actual_val = func_obj(ctxt, ['fake_device'], 'fake_agent_id')
import os
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import six.moves.urllib.parse as urlparse
import webob
from webob import exc
import uuid
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from webob import exc
import webtest
# under the License.
import mock
-from oslo import i18n
+import oslo_i18n
from webob import exc
import webtest
def test_best_match_language(self):
# Test that we are actually invoking language negotiation by webop
request = wsgi.Request.blank('/')
- i18n.get_available_languages = mock.MagicMock()
- i18n.get_available_languages.return_value = ['known-language',
- 'es', 'zh']
+ oslo_i18n.get_available_languages = mock.MagicMock()
+ oslo_i18n.get_available_languages.return_value = ['known-language',
+ 'es', 'zh']
request.headers['Accept-Language'] = 'known-language'
language = request.best_match_language()
self.assertEqual(language, 'known-language')
self.assertEqual(wsgi.JSONDeserializer().deserialize(res.body),
expected_res)
- @mock.patch('oslo.i18n.translate')
+ @mock.patch('oslo_i18n.translate')
def test_unmapped_neutron_error_localized(self, mock_translation):
msg_translation = 'Translated error'
mock_translation.return_value = msg_translation
self.assertEqual(wsgi.JSONDeserializer().deserialize(res.body),
expected_res)
- @mock.patch('oslo.i18n.translate')
+ @mock.patch('oslo_i18n.translate')
def test_mapped_neutron_error_localized(self, mock_translation):
msg_translation = 'Translated error'
mock_translation.return_value = msg_translation
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.middleware import request_id
+from oslo_middleware import request_id
import webob
from neutron import auth
# limitations under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import config
from neutron.tests import base
import itertools
import mock
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from testtools import matchers
import webob.exc
import socket
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.agent.linux import interface
import eventlet
import mock
-from oslo.config import cfg
-from oslo import messaging
+from oslo_config import cfg
+import oslo_messaging
import testtools
from neutron.agent.common import config
def test_call_driver_remote_error_net_not_found(self):
self._test_call_driver_failure(
- exc=messaging.RemoteError(exc_type='NetworkNotFound'),
+ exc=oslo_messaging.RemoteError(exc_type='NetworkNotFound'),
trace_level='warning')
def test_call_driver_network_not_found(self):
# limitations under the License.
import mock
-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.common import constants
import datetime
import mock
-from oslo.utils import timeutils
+from oslo_utils import timeutils
import testscenarios
-
from neutron.common import constants
from neutron.common import topics
from neutron import context
from neutron.extensions import securitygroup as secgroup
from neutron import manager
from neutron.tests.unit import test_db_plugin
-from oslo.config import cfg
+from oslo_config import cfg
DB_PLUGIN_KLASS = ('neutron.tests.unit.test_extension_allowedaddresspairs.'
#
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from webob import exc
from neutron.common import constants
Unit tests for extension extended attribute
"""
-from oslo.config import cfg
+from oslo_config import cfg
import webob.exc as webexc
import neutron
# under the License.
import contextlib
-from oslo.config import cfg
+from oslo_config import cfg
from webob import exc
from neutron.common import constants
# under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from webob import exc as web_exc
import webtest
import abc
import mock
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
import routes
import webob
import webtest
import copy
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config as a_cfg
from neutron.agent.linux import ipset_manager
import sys
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config as a_cfg
from neutron.agent.linux import iptables_comments as ic
import mock
import netaddr
-from oslo import messaging
+import oslo_messaging
from testtools import matchers
from neutron.agent.common import config as agent_config
self.assertTrue(self.plugin_api.get_service_plugin_list.called)
def test_get_service_plugin_list_failed(self):
- raise_rpc = messaging.RemoteError()
+ raise_rpc = oslo_messaging.RemoteError()
self.plugin_api.get_service_plugin_list.side_effect = raise_rpc
agent = l3_agent.L3NATAgent(HOSTNAME, self.conf)
self.assertIsNone(agent.neutron_service_plugins)
self.assertTrue(self.plugin_api.get_service_plugin_list.called)
def test_get_service_plugin_list_retried(self):
- raise_timeout = messaging.MessagingTimeout()
+ raise_timeout = oslo_messaging.MessagingTimeout()
# Raise a timeout the first 2 times it calls
# get_service_plugin_list then return a empty tuple
self.plugin_api.get_service_plugin_list.side_effect = (
self.assertEqual(agent.neutron_service_plugins, tuple())
def test_get_service_plugin_list_retried_max(self):
- raise_timeout = messaging.MessagingTimeout()
+ raise_timeout = oslo_messaging.MessagingTimeout()
# Raise a timeout 5 times
self.plugin_api.get_service_plugin_list.side_effect = (
(raise_timeout, ) * 5
)
- self.assertRaises(messaging.MessagingTimeout, l3_agent.L3NATAgent,
+ self.assertRaises(oslo_messaging.MessagingTimeout, l3_agent.L3NATAgent,
HOSTNAME, self.conf)
def test_external_gateway_removed_ext_gw_port_and_fip(self):
import mock
import netaddr
-from oslo.config import cfg
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_utils import importutils
from webob import exc
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
import mock
import testscenarios
-from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo.utils import importutils
-from oslo.utils import timeutils
+from oslo_config import cfg
+from oslo_db import exception as db_exc
+from oslo_utils import importutils
+from oslo_utils import timeutils
from sqlalchemy.orm import query
from neutron.common import constants
import mock
import netaddr
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.agent.common import config
from neutron.agent.dhcp import config as dhcp_config
'not_used': [1, 2, 3]}
expected_networks = ('network_id1',)
with mock.patch(
- 'oslo.utils.timeutils.utcnow_ts', return_value=0):
+ 'oslo_utils.timeutils.utcnow_ts', return_value=0):
mock_list_ports = self.qclient.return_value.list_ports
mock_list_ports.return_value = ports
networks = self.handler._get_router_networks(router_id)
conf.AGENT.root_helper = 'sudo',
conf.dhcp_driver = 'driver'
- method_to_patch = 'oslo.utils.importutils.import_object'
+ method_to_patch = 'oslo_utils.importutils.import_object'
with mock.patch(method_to_patch) as import_object:
driver = mock.Mock()
import fixtures
-from oslo.config import cfg
+from oslo_config import cfg
from neutron import manager
from neutron.openstack.common import log as logging
import urllib2
import mock
-from oslo.config import cfg
-from oslo.serialization import jsonutils
-from oslo.utils import importutils
+from oslo_config import cfg
+from oslo_serialization import jsonutils
+from oslo_utils import importutils
import six
import six.moves.urllib.request as urlrequest
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import exceptions as n_exc
from neutron import manager
import sys
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import testtools
from webob import exc
import webtest
# under the License.
import mock
-from oslo.config import cfg
-from oslo.messaging import conffixture as messaging_conffixture
+from oslo_config import cfg
+from oslo_messaging import conffixture as messaging_conffixture
from neutron.common import rpc
from neutron.tests import sub_base
self.host = 'foo'
self.topic = 'neutron-agent'
- self.target_mock = mock.patch('oslo.messaging.Target')
+ self.target_mock = mock.patch('oslo_messaging.Target')
self.target_mock.start()
self.messaging_conf = messaging_conffixture.ConfFixture(CONF)
rpc.init(CONF)
def test_operations(self):
- with mock.patch('oslo.messaging.get_rpc_server') as get_rpc_server:
+ with mock.patch('oslo_messaging.get_rpc_server') as get_rpc_server:
rpc_server = get_rpc_server.return_value
service = rpc.Service(self.host, self.topic)
import collections
import mock
-from oslo.config import cfg
-from oslo import messaging
+from oslo_config import cfg
+import oslo_messaging
from testtools import matchers
import webob.exc
defer_refresh_firewall)
rpc = self.agent.plugin_rpc
rpc.security_group_info_for_devices.side_effect = (
- messaging.UnsupportedVersion('1.2'))
+ oslo_messaging.UnsupportedVersion('1.2'))
rpc.security_group_rules_for_devices.return_value = (
self.firewall.ports)
class FakeSGNotifierAPI(sg_rpc.SecurityGroupAgentRpcApiMixin):
def __init__(self):
self.topic = 'fake'
- target = messaging.Target(topic=self.topic, version='1.0')
+ target = oslo_messaging.Target(topic=self.topic, version='1.0')
self.client = n_rpc.get_client(target)
if test_rpc_v1_1:
self.rpc.security_group_info_for_devices.side_effect = (
- messaging.UnsupportedVersion('1.2'))
+ oslo_messaging.UnsupportedVersion('1.2'))
self.iptables = self.agent.firewall.iptables
# TODO(jlibosva) Get rid of mocking iptables execute and mock out
# under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import webob.exc as webexc
import webtest
import urllib2
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import testtools
import webob
import webob.exc
import weakref
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.db import agentschedulers_db
from neutron import manager
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
import six.moves.urllib.parse as urlparse
from neutron.openstack.common import log as logging
# See the License for the specific language governing permissions and
# limitations under the License.
-from oslo.db import exception as d_exc
+from oslo_db import exception as d_exc
from neutron import context
from neutron.db import models_v2
import contextlib
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.api.v2 import attributes
from neutron.common import test_lib
import contextlib
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from webob import exc
import webtest
# License for the specific language governing permissions and limitations
# under the License.
-from oslo.config import cfg
+from oslo_config import cfg
import webob.exc
from neutron.extensions import multiprovidernet as mpnet
import contextlib
import mock
-from oslo.config import cfg
+from oslo_config import cfg
import webob.exc
from neutron import context
#
import mock
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.plugins.vmware.api_client import exception
from neutron.plugins.vmware.common import utils as nsx_utils
# limitations under the License.
import mock
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.common import exceptions
from neutron.plugins.vmware.api_client import exception as api_exc
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import exceptions
from neutron.openstack.common import uuidutils
# under the License.
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants
from neutron.common import test_lib
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron.common import constants as n_consts
from neutron.common import exceptions as n_exc
import fixtures
import mock
-from oslo.config import cfg
+from oslo_config import cfg
from neutron import manager
from neutron.openstack.common import uuidutils
import mock
import netaddr
-from oslo.config import cfg
-from oslo.db import exception as db_exc
+from oslo_config import cfg
+from oslo_db import exception as db_exc
from sqlalchemy import exc as sql_exc
import webob.exc
import time
import mock
-from oslo.config import cfg
-from oslo.serialization import jsonutils
+from oslo_config import cfg
+from oslo_serialization import jsonutils
from neutron.api.v2 import attributes as attr
from neutron.common import constants
import copy
-from oslo.serialization import jsonutils
+from oslo_serialization import jsonutils
from neutron.openstack.common import uuidutils
from neutron.plugins.vmware.vshield.common import exceptions
import eventlet.wsgi
eventlet.patcher.monkey_patch(all=False, socket=True, thread=True)
-from oslo.config import cfg
-from oslo import i18n
-from oslo.serialization import jsonutils
-from oslo.utils import excutils
+from oslo_config import cfg
+import oslo_i18n
+from oslo_serialization import jsonutils
+from oslo_utils import excutils
import routes.middleware
import webob.dec
import webob.exc
"""
if not self.accept_language:
return None
- all_languages = i18n.get_available_languages('neutron')
+ all_languages = oslo_i18n.get_available_languages('neutron')
return self.accept_language.best_match(all_languages)
@property
if not match:
language = req.best_match_language()
msg = _('The resource could not be found.')
- msg = i18n.translate(msg, language)
+ msg = oslo_i18n.translate(msg, language)
return webob.exc.HTTPNotFound(explanation=msg)
app = match['controller']
return app
memory = neutron.openstack.common.cache._backends.memory:MemoryBackend
# These are for backwards compat with Icehouse notification_driver configuration values
oslo.messaging.notify.drivers =
- neutron.openstack.common.notifier.log_notifier = oslo.messaging.notify._impl_log:LogDriver
- neutron.openstack.common.notifier.no_op_notifier = oslo.messaging.notify._impl_noop:NoOpDriver
- neutron.openstack.common.notifier.rpc_notifier2 = oslo.messaging.notify._impl_messaging:MessagingV2Driver
- neutron.openstack.common.notifier.rpc_notifier = oslo.messaging.notify._impl_messaging:MessagingDriver
- neutron.openstack.common.notifier.test_notifier = oslo.messaging.notify._impl_test:TestDriver
+ neutron.openstack.common.notifier.log_notifier = oslo_messaging.notify._impl_log:LogDriver
+ neutron.openstack.common.notifier.no_op_notifier = oslo_messaging.notify._impl_noop:NoOpDriver
+ neutron.openstack.common.notifier.rpc_notifier2 = oslo_messaging.notify._impl_messaging:MessagingV2Driver
+ neutron.openstack.common.notifier.rpc_notifier = oslo_messaging.notify._impl_messaging:MessagingDriver
+ neutron.openstack.common.notifier.test_notifier = oslo_messaging.notify._impl_test:TestDriver
[build_sphinx]
all_files = 1