oslo: migrate to namespace-less import paths

Oslo project decided to move away from using oslo.* namespace for all their
libraries [1], so we should migrate to new import path.

This patch applies new paths for:
- oslo.config
- oslo.db
- oslo.i18n
- oslo.messaging
- oslo.middleware
- oslo.rootwrap
- oslo.serialization
- oslo.utils

Added hacking check to enforce new import paths for all oslo libraries.

Updated setup.cfg entry points.

We'll cleanup old imports from oslo-incubator modules on demand or
if/when oslo officially deprecates old namespace in one of the next
cycles.

[1]: https://blueprints.launchpad.net/oslo-incubator/+spec/drop-namespace-packages

Depends-On: https://review.openstack.org/#/c/147248/
Depends-On: https://review.openstack.org/#/c/152292/
Depends-On: https://review.openstack.org/#/c/147240/

Closes-Bug: #1409733
Change-Id: If0dce29a0980206ace9866112be529436194d47e
changes/15/147215/11
Ihar Hrachyshka 8 years ago
parent 38f2704a85
commit 7a2a85623d
  1. 1
      HACKING.rst
  2. 2
      neutron/agent/common/config.py
  3. 12
      neutron/agent/dhcp/agent.py
  4. 2
      neutron/agent/dhcp/config.py
  5. 2
      neutron/agent/dhcp_agent.py
  6. 2
      neutron/agent/l2population_rpc.py
  7. 28
      neutron/agent/l3/agent.py
  8. 2
      neutron/agent/l3/config.py
  9. 2
      neutron/agent/l3/ha.py
  10. 2
      neutron/agent/l3/router_processing_queue.py
  11. 2
      neutron/agent/l3_agent.py
  12. 4
      neutron/agent/linux/dhcp.py
  13. 4
      neutron/agent/linux/external_process.py
  14. 4
      neutron/agent/linux/interface.py
  15. 2
      neutron/agent/linux/ip_lib.py
  16. 2
      neutron/agent/linux/iptables_firewall.py
  17. 4
      neutron/agent/linux/iptables_manager.py
  18. 2
      neutron/agent/linux/keepalived.py
  19. 4
      neutron/agent/linux/ovs_lib.py
  20. 4
      neutron/agent/linux/ovsdb_vsctl.py
  21. 2
      neutron/agent/linux/ra.py
  22. 2
      neutron/agent/linux/utils.py
  23. 15
      neutron/agent/metadata/agent.py
  24. 2
      neutron/agent/metadata/config.py
  25. 2
      neutron/agent/metadata/driver.py
  26. 2
      neutron/agent/metadata/namespace_proxy.py
  27. 2
      neutron/agent/metadata_agent.py
  28. 4
      neutron/agent/ovsdb.py
  29. 10
      neutron/agent/rpc.py
  30. 13
      neutron/agent/securitygroups_rpc.py
  31. 2
      neutron/api/api_common.py
  32. 2
      neutron/api/extensions.py
  33. 4
      neutron/api/rpc/agentnotifiers/dhcp_rpc_agent_api.py
  34. 4
      neutron/api/rpc/agentnotifiers/l3_rpc_agent_api.py
  35. 4
      neutron/api/rpc/agentnotifiers/metering_rpc_agent_api.py
  36. 13
      neutron/api/rpc/handlers/dhcp_rpc.py
  37. 6
      neutron/api/rpc/handlers/dvr_rpc.py
  38. 8
      neutron/api/rpc/handlers/l3_rpc.py
  39. 6
      neutron/api/rpc/handlers/metadata_rpc.py
  40. 6
      neutron/api/rpc/handlers/securitygroups_rpc.py
  41. 4
      neutron/api/v2/base.py
  42. 4
      neutron/api/v2/resource.py
  43. 2
      neutron/api/v2/resource_helper.py
  44. 2
      neutron/api/v2/router.py
  45. 4
      neutron/api/versions.py
  46. 4
      neutron/auth.py
  47. 4
      neutron/cmd/netns_cleanup.py
  48. 2
      neutron/cmd/ovs_cleanup.py
  49. 2
      neutron/cmd/sanity_check.py
  50. 8
      neutron/common/config.py
  51. 2
      neutron/common/exceptions.py
  52. 4
      neutron/common/repos.py
  53. 28
      neutron/common/rpc.py
  54. 4
      neutron/common/utils.py
  55. 12
      neutron/db/agents_db.py
  56. 4
      neutron/db/agentschedulers_db.py
  57. 4
      neutron/db/api.py
  58. 6
      neutron/db/db_base_plugin_v2.py
  59. 4
      neutron/db/dvr_mac_db.py
  60. 2
      neutron/db/extraroute_db.py
  61. 8
      neutron/db/l3_agentschedulers_db.py
  62. 2
      neutron/db/l3_dvr_db.py
  63. 2
      neutron/db/l3_dvrscheduler_db.py
  64. 6
      neutron/db/l3_hamode_db.py
  65. 4
      neutron/db/metering/metering_rpc.py
  66. 4
      neutron/db/migration/alembic_migrations/env.py
  67. 4
      neutron/db/migration/cli.py
  68. 2
      neutron/db/migration/migrate_to_ml2.py
  69. 2
      neutron/db/model_base.py
  70. 2
      neutron/debug/debug_agent.py
  71. 4
      neutron/debug/shell.py
  72. 2
      neutron/extensions/allowedaddresspairs.py
  73. 2
      neutron/extensions/l3.py
  74. 4
      neutron/extensions/quotasv2.py
  75. 2
      neutron/extensions/securitygroup.py
  76. 18
      neutron/hacking/checks.py
  77. 4
      neutron/i18n.py
  78. 8
      neutron/manager.py
  79. 2
      neutron/notifiers/nova.py
  80. 8
      neutron/plugins/bigswitch/agent/restproxy_agent.py
  81. 2
      neutron/plugins/bigswitch/config.py
  82. 6
      neutron/plugins/bigswitch/db/consistency_db.py
  83. 4
      neutron/plugins/bigswitch/l3_router_plugin.py
  84. 8
      neutron/plugins/bigswitch/plugin.py
  85. 2
      neutron/plugins/bigswitch/routerrule_db.py
  86. 6
      neutron/plugins/bigswitch/servermanager.py
  87. 2
      neutron/plugins/bigswitch/tests/test_server.py
  88. 10
      neutron/plugins/brocade/NeutronPlugin.py
  89. 2
      neutron/plugins/brocade/nos/nosdriver.py
  90. 12
      neutron/plugins/cisco/cfg_agent/cfg_agent.py
  91. 2
      neutron/plugins/cisco/cfg_agent/device_drivers/csr1kv/csr1kv_routing_driver.py
  92. 4
      neutron/plugins/cisco/cfg_agent/device_drivers/driver_mgr.py
  93. 2
      neutron/plugins/cisco/cfg_agent/device_drivers/dummy_driver.py
  94. 4
      neutron/plugins/cisco/cfg_agent/device_status.py
  95. 8
      neutron/plugins/cisco/cfg_agent/service_helpers/routing_svc_helper.py
  96. 2
      neutron/plugins/cisco/common/config.py
  97. 6
      neutron/plugins/cisco/db/l3/device_handling_db.py
  98. 2
      neutron/plugins/cisco/db/l3/l3_router_appliance_db.py
  99. 4
      neutron/plugins/cisco/l3/hosting_device_drivers/csr1kv_hd_driver.py
  100. 2
      neutron/plugins/cisco/l3/plugging_drivers/n1kv_trunking_driver.py
  101. Some files were not shown because too many files have changed in this diff Show More

@ -12,6 +12,7 @@ Neutron Specific Commandments
- [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
-------------------

@ -15,7 +15,7 @@
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

@ -18,9 +18,9 @@ import os
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
@ -49,7 +49,7 @@ class DhcpAgent(manager.Manager):
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)
@ -125,7 +125,7 @@ class DhcpAgent(manager.Manager):
{'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)
@ -400,7 +400,7 @@ class DhcpPluginApi(object):
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')

@ -14,7 +14,7 @@
# 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,

@ -19,7 +19,7 @@ import sys
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

@ -15,7 +15,7 @@
import abc
from oslo.config import cfg
from oslo_config import cfg
import six
from neutron.common import constants as n_const

@ -15,11 +15,11 @@
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
@ -77,7 +77,7 @@ class L3PluginApi(object):
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):
@ -89,9 +89,9 @@ class L3PluginApi(object):
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)
@ -138,7 +138,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback,
- 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:
@ -178,7 +178,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback,
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 '
@ -189,7 +189,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback,
'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
@ -335,7 +335,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback,
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
@ -1172,7 +1172,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback,
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)

@ -14,7 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
from oslo_config import cfg
OPTS = [

@ -15,7 +15,7 @@
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

@ -16,7 +16,7 @@
import datetime
import Queue
from oslo.utils import timeutils
from oslo_utils import timeutils
# Lower value is higher priority
PRIORITY_RPC = 0

@ -19,7 +19,7 @@ import sys
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

@ -22,8 +22,8 @@ import socket
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

@ -16,8 +16,8 @@ import collections
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
@ -135,7 +135,7 @@ class ProcessMonitor(object):
"""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.

@ -16,8 +16,8 @@
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

@ -17,7 +17,7 @@ import eventlet
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

@ -14,7 +14,7 @@
# 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

@ -23,9 +23,9 @@ import os
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

@ -18,7 +18,7 @@ import os
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

@ -17,8 +17,8 @@ import collections
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

@ -16,8 +16,8 @@ import collections
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

@ -15,7 +15,7 @@
import jinja2
import netaddr
from oslo.config import cfg
from oslo_config import cfg
import six
from neutron.agent.linux import utils

@ -23,7 +23,7 @@ import tempfile
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

@ -20,9 +20,9 @@ import socket
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
@ -56,9 +56,10 @@ class MetadataPluginAPI(object):
"""
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):
@ -121,7 +122,7 @@ class MetadataProxyHandler(object):
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, '

@ -12,7 +12,7 @@
# 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

@ -15,7 +15,7 @@
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

@ -19,7 +19,7 @@ import eventlet
eventlet.monkey_patch()
import httplib2
from oslo.config import cfg
from oslo_config import cfg
import six.moves.urllib.parse as urlparse
import webob

@ -17,7 +17,7 @@ import sys
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

@ -14,8 +14,8 @@
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 = {

@ -14,8 +14,8 @@
# 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
@ -58,7 +58,7 @@ def create_consumers(endpoints, prefix, topic_details, start_listening=True):
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):
@ -82,7 +82,7 @@ class PluginApi(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 get_device_details(self, context, device, agent_id, host=None):
@ -95,7 +95,7 @@ class PluginApi(object):
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

@ -16,9 +16,9 @@
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
@ -96,8 +96,9 @@ class SecurityGroupServerRpcApi(object):
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):
@ -199,7 +200,7 @@ class SecurityGroupAgentRpc(object):
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 '

@ -15,7 +15,7 @@
import urllib
from oslo.config import cfg
from oslo_config import cfg
from webob import exc
from neutron.common import constants

@ -20,7 +20,7 @@ import imp
import itertools
import os
from oslo.config import cfg
from oslo_config import cfg
import routes
import six
import webob.dec

@ -13,7 +13,7 @@
# 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
@ -48,7 +48,7 @@ class DhcpAgentNotifyAPI(object):
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

@ -15,7 +15,7 @@
import random
from oslo import messaging
import oslo_messaging
from neutron.common import constants
from neutron.common import rpc as n_rpc
@ -34,7 +34,7 @@ class L3AgentNotifyAPI(object):
"""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):

@ -12,7 +12,7 @@
# 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
@ -30,7 +30,7 @@ class MeteringAgentNotifyAPI(object):
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):

@ -16,10 +16,10 @@
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
@ -47,8 +47,9 @@ class DhcpRpcCallback(object):
# 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."""

@ -13,7 +13,7 @@
# 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
@ -28,7 +28,7 @@ class DVRServerRpcApi(object):
"""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
@ -59,7 +59,7 @@ class DVRServerRpcCallback(object):
# History
# 1.0 Initial version
target = messaging.Target(version='1.0')
target = oslo_messaging.Target(version='1.0')
@property
def plugin(self):

@ -13,9 +13,9 @@
# 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
@ -40,7 +40,7 @@ class L3RpcCallback(object):
# 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):

@ -13,7 +13,7 @@
# 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
@ -30,8 +30,8 @@ class MetadataRpcCallback(object):
"""
# 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):

@ -12,7 +12,7 @@
# 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
@ -37,8 +37,8 @@ class SecurityGroupServerRpcCallback(object):
# 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):

@ -17,8 +17,8 @@ import copy
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

@ -20,7 +20,7 @@ Utility methods for working with WSGI servers redux
import sys
import netaddr
from oslo import i18n
import oslo_i18n
import six
import webob.dec
import webob.exc
@ -173,7 +173,7 @@ def translate(translatable, locale):
: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):

@ -13,7 +13,7 @@
# 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

@ -13,7 +13,7 @@
# 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

@ -13,7 +13,7 @@
# 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
@ -43,7 +43,7 @@ class Versions(object):
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)

@ -12,8 +12,8 @@
# 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

@ -18,8 +18,8 @@ import re
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

@ -13,7 +13,7 @@
# 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

@ -20,7 +20,7 @@ from neutron.cmd.sanity import checks
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__)

@ -20,9 +20,9 @@ Routines for configuring Neutron
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
@ -134,7 +134,7 @@ cfg.CONF.register_opts(core_opts)
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

@ -17,7 +17,7 @@
Neutron base exception handling.
"""
from oslo.utils import excutils
from oslo_utils import excutils
class NeutronException(Exception):

@ -17,7 +17,7 @@ import ConfigParser
import importlib
import os
from oslo.config import cfg
from oslo_config import cfg
from neutron.openstack.common import log as logging
@ -62,7 +62,7 @@ class NeutronModules(object):
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.

@ -14,9 +14,9 @@
# 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
@ -51,11 +51,11 @@ TRANSPORT_ALIASES = {
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():
@ -81,17 +81,17 @@ def get_allowed_exmods():
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):
@ -185,7 +185,7 @@ class Connection(object):
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)

@ -31,9 +31,9 @@ import socket
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

@ -15,11 +15,11 @@
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
@ -222,7 +222,7 @@ class AgentDbMixin(ext_agent.AgentPluginBase):
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):

@ -17,8 +17,8 @@ import datetime
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

@ -13,8 +13,8 @@
# 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