Switch to using oslo_* instead of oslo.*
The oslo team is recommending everyone to switch to the non-namespaced versions of libraries. Updating the hacking rule to include a check to prevent oslo.* import from creeping back in. This commit includes: - using oslo_utils instead of oslo.utils - using oslo_serialization instead of oslo.serialization - using oslo_db instead of oslo.db - using oslo_i18n instead of oslo.i18n - using oslo_middleware instead of oslo.middleware - using oslo_config instead of oslo.config - using oslo_messaging instead of "from oslo import messaging" - using oslo_vmware instead of oslo.vmware Change-Id: I3e2eb147b321ce3e928817b62abcb7d023c5f13f
This commit is contained in:
parent
64df58a713
commit
d015a3c7aa
@ -27,8 +27,8 @@ these objects be simple dictionaries.
|
||||
|
||||
"""
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.db import concurrency
|
||||
from oslo_config import cfg
|
||||
from oslo_db import concurrency
|
||||
|
||||
from nova.cells import rpcapi as cells_rpcapi
|
||||
from nova.i18n import _LE
|
||||
|
@ -16,8 +16,8 @@
|
||||
|
||||
"""Base class for classes that need modular database access."""
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.utils import importutils
|
||||
from oslo_config import cfg
|
||||
from oslo_utils import importutils
|
||||
|
||||
db_driver_opt = cfg.StrOpt('db_driver',
|
||||
default='nova.db',
|
||||
|
@ -26,12 +26,12 @@ import threading
|
||||
import time
|
||||
import uuid
|
||||
|
||||
from oslo.config import cfg
|
||||
from oslo.db import exception as db_exc
|
||||
from oslo.db.sqlalchemy import session as db_session
|
||||
from oslo.db.sqlalchemy import utils as sqlalchemyutils
|
||||
from oslo.utils import excutils
|
||||
from oslo.utils import timeutils
|
||||
from oslo_config import cfg
|
||||
from oslo_db import exception as db_exc
|
||||
from oslo_db.sqlalchemy import session as db_session
|
||||
from oslo_db.sqlalchemy import utils as sqlalchemyutils
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import timeutils
|
||||
import retrying
|
||||
import six
|
||||
from sqlalchemy import and_
|
||||
|
@ -19,7 +19,7 @@ import os
|
||||
from migrate import exceptions as versioning_exceptions
|
||||
from migrate.versioning import api as versioning_api
|
||||
from migrate.versioning.repository import Repository
|
||||
from oslo.db.sqlalchemy import utils as db_utils
|
||||
from oslo_db.sqlalchemy import utils as db_utils
|
||||
import sqlalchemy
|
||||
from sqlalchemy.sql import null
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
"""Custom SQLAlchemy types."""
|
||||
|
||||
import netaddr
|
||||
from oslo.utils import netutils
|
||||
from oslo_utils import netutils
|
||||
from sqlalchemy.dialects import postgresql
|
||||
from sqlalchemy import types
|
||||
|
||||
|
@ -13,8 +13,8 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo.db import exception as db_exc
|
||||
from oslo.db.sqlalchemy import utils as oslodbutils
|
||||
from oslo_db import exception as db_exc
|
||||
from oslo_db.sqlalchemy import utils as oslodbutils
|
||||
from sqlalchemy.exc import OperationalError
|
||||
from sqlalchemy.ext.compiler import compiles
|
||||
from sqlalchemy import MetaData
|
||||
|
@ -18,11 +18,11 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html .
|
||||
|
||||
"""
|
||||
|
||||
from oslo import i18n
|
||||
import oslo_i18n
|
||||
|
||||
DOMAIN = 'nova'
|
||||
|
||||
_translators = i18n.TranslatorFactory(domain=DOMAIN)
|
||||
_translators = oslo_i18n.TranslatorFactory(domain=DOMAIN)
|
||||
|
||||
# The primary translation function using the well-known name "_"
|
||||
_ = _translators.primary
|
||||
@ -39,8 +39,8 @@ _LC = _translators.log_critical
|
||||
|
||||
|
||||
def translate(value, user_locale):
|
||||
return i18n.translate(value, user_locale)
|
||||
return oslo_i18n.translate(value, user_locale)
|
||||
|
||||
|
||||
def get_available_languages():
|
||||
return i18n.get_available_languages(DOMAIN)
|
||||
return oslo_i18n.get_available_languages(DOMAIN)
|
||||
|
@ -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 nova.openstack.common import log as logging
|
||||
from nova.scheduler import filters
|
||||
|
@ -31,10 +31,10 @@ import mock
|
||||
import os
|
||||
|
||||
import fixtures
|
||||
from oslo.config import cfg
|
||||
from oslo.config import fixture as config_fixture
|
||||
from oslo.utils import timeutils
|
||||
from oslo_concurrency import lockutils
|
||||
from oslo_config import cfg
|
||||
from oslo_config import fixture as config_fixture
|
||||
from oslo_utils import timeutils
|
||||
from oslotest import moxstubout
|
||||
import six
|
||||
import testtools
|
||||
|
@ -24,8 +24,8 @@ import uuid
|
||||
import warnings
|
||||
|
||||
import fixtures
|
||||
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 nova.db import migration
|
||||
from nova.db.sqlalchemy import api as session
|
||||
|
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
|
||||
import mock
|
||||
from oslo.utils import timeutils
|
||||
from oslo_utils import timeutils
|
||||
|
||||
from nova import db
|
||||
from nova import exception
|
||||
|
@ -15,8 +15,8 @@
|
||||
import os
|
||||
|
||||
import fixtures
|
||||
from oslo.config import cfg
|
||||
from oslo.serialization import jsonutils
|
||||
from oslo_config import cfg
|
||||
from oslo_serialization import jsonutils
|
||||
|
||||
from nova.openstack.common import policy as common_policy
|
||||
import nova.policy
|
||||
|
@ -36,13 +36,13 @@ from xml.sax import saxutils
|
||||
|
||||
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_concurrency import lockutils
|
||||
from oslo_concurrency import processutils
|
||||
from oslo_config import cfg
|
||||
import oslo_messaging as messaging
|
||||
from oslo_utils import excutils
|
||||
from oslo_utils import importutils
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
|
||||
from nova import exception
|
||||
|
Loading…
Reference in New Issue
Block a user