oslo: migrate to namespace-less import paths

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

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

Hacking check will be added in Neutron once all *aas repositories are converted
to namespace-less imports.

Related-Bug: #1409733
Change-Id: If0dce29a0980206ace9866112be529436194d47e
changes/48/147248/6
Ihar Hrachyshka 8 years ago
parent 1950edcf4e
commit a87fbf1575
  1. 2
      neutron_fwaas/db/firewall/firewall_db.py
  2. 4
      neutron_fwaas/db/migration/alembic_migrations/env.py
  3. 2
      neutron_fwaas/extensions/firewall.py
  4. 6
      neutron_fwaas/services/firewall/agents/firewall_agent_api.py
  5. 4
      neutron_fwaas/services/firewall/agents/firewall_service.py
  6. 2
      neutron_fwaas/services/firewall/agents/l3reference/firewall_l3_agent.py
  7. 4
      neutron_fwaas/services/firewall/agents/varmour/varmour_api.py
  8. 2
      neutron_fwaas/services/firewall/agents/varmour/varmour_router.py
  9. 2
      neutron_fwaas/services/firewall/freescale/fwaas_plugin.py
  10. 8
      neutron_fwaas/services/firewall/fwaas_plugin.py
  11. 2
      neutron_fwaas/tests/base.py
  12. 4
      neutron_fwaas/tests/unit/db/firewall/test_db_firewall.py
  13. 6
      neutron_fwaas/tests/unit/services/firewall/agents/l3reference/test_firewall_l3_agent.py
  14. 2
      neutron_fwaas/tests/unit/services/firewall/drivers/linux/test_iptables_fwaas.py
  15. 2
      neutron_fwaas/tests/unit/services/firewall/test_firewall_service.py

@ -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
import sqlalchemy as sa
from sqlalchemy.ext.orderinglist import ordering_list

@ -16,8 +16,8 @@ from logging import config as logging_config
from alembic import context
from neutron.db import model_base
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

@ -15,7 +15,7 @@
import abc
from oslo.config import cfg
from oslo_config import cfg
import six
from neutron.api import extensions

@ -13,8 +13,8 @@
# 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
@ -39,7 +39,7 @@ class FWaaSPluginApiMixin(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 set_firewall_status(self, context, firewall_id, status):

@ -16,8 +16,8 @@
from neutron.openstack.common import log as logging
from neutron.services import advanced_service
from neutron.services import provider_configuration as provconf
from oslo.config import cfg
from oslo.utils import importutils
from oslo_config import cfg
from oslo_utils import importutils
LOG = logging.getLogger(__name__)

@ -20,7 +20,7 @@ from neutron import context
from neutron.i18n import _LE
from neutron.openstack.common import log as logging
from neutron.plugins.common import constants
from oslo.config import cfg
from oslo_config import cfg
from neutron_fwaas.extensions import firewall as fw_ext
from neutron_fwaas.services.firewall.agents import firewall_agent_api as api

@ -16,8 +16,8 @@
import base64
import httplib2
from oslo.config import cfg
from oslo.serialization import jsonutils
from oslo_config import cfg
from oslo_serialization import jsonutils
from neutron.i18n import _LE
from neutron.openstack.common import log as logging

@ -19,7 +19,7 @@ import eventlet
eventlet.monkey_patch()
import netaddr
from oslo.config import cfg
from oslo_config import cfg
from neutron.agent.common import config
from neutron.agent.l3 import agent

@ -20,7 +20,7 @@ from neutron.i18n import _LE
from neutron.openstack.common import log as logging
from neutron.plugins.common import constants as const
from neutron.plugins.ml2.drivers.freescale import config
from oslo.utils import excutils
from oslo_utils import excutils
from sqlalchemy.orm import exc
from neutron_fwaas.db.firewall import firewall_db

@ -20,8 +20,8 @@ from neutron import context as neutron_context
from neutron.i18n import _LW
from neutron.openstack.common import log as logging
from neutron.plugins.common import constants as const
from oslo.config import cfg
from oslo import messaging
from oslo_config import cfg
import oslo_messaging
from neutron_fwaas.db.firewall import firewall_db
from neutron_fwaas.extensions import firewall as fw_ext
@ -31,7 +31,7 @@ LOG = logging.getLogger(__name__)
class FirewallCallbacks(object):
target = messaging.Target(version='1.0')
target = oslo_messaging.Target(version='1.0')
def __init__(self, plugin):
super(FirewallCallbacks, self).__init__()
@ -103,7 +103,7 @@ class FirewallAgentApi(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 create_firewall(self, context, firewall):

@ -19,7 +19,7 @@ import os
import neutron
from neutron.tests import base as n_base
from neutron.tests.unit import test_db_plugin
from oslo.config import cfg
from oslo_config import cfg
def override_nvalues():

@ -23,8 +23,8 @@ import neutron.extensions
from neutron import manager
from neutron.openstack.common import uuidutils
from neutron.plugins.common import constants
from oslo.config import cfg
from oslo.utils import importutils
from oslo_config import cfg
from oslo_utils import importutils
import webob.exc
from neutron_fwaas.db.firewall import firewall_db as fdb

@ -16,7 +16,7 @@ import contextlib
import uuid
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
@ -86,7 +86,7 @@ class TestFwaasL3AgentRpcCallback(base.BaseTestCase):
def test_fw_config_match(self):
test_agent_class = _setup_test_agent_class([constants.FIREWALL])
cfg.CONF.set_override('enabled', True, 'fwaas')
with mock.patch('oslo.utils.importutils.import_object'):
with mock.patch('oslo_utils.importutils.import_object'):
test_agent_class(cfg.CONF)
def test_fw_config_mismatch_plugin_enabled_agent_disabled(self):
@ -97,7 +97,7 @@ class TestFwaasL3AgentRpcCallback(base.BaseTestCase):
def test_fw_plugin_list_unavailable(self):
test_agent_class = _setup_test_agent_class(None)
cfg.CONF.set_override('enabled', False, 'fwaas')
with mock.patch('oslo.utils.importutils.import_object'):
with mock.patch('oslo_utils.importutils.import_object'):
test_agent_class(cfg.CONF)
def test_create_firewall(self):

@ -14,7 +14,7 @@
# under the License.
import mock
from oslo.config import cfg
from oslo_config import cfg
from neutron.agent.common import config as a_cfg
from neutron.tests import base

@ -16,7 +16,7 @@
import mock
from neutron.tests import base
from oslo.config import cfg
from oslo_config import cfg
from neutron_fwaas.services.firewall.agents import firewall_service

Loading…
Cancel
Save