warnings.simplefilter('once', DeprecationWarning)
from oslo.config import cfg
-from oslo.db.sqlalchemy import migration
from oslo import messaging
+from oslo_db.sqlalchemy import migration
from cinder import i18n
i18n.enable_lazy()
"""
from oslo.config import cfg
-from oslo.db import concurrency as db_concurrency
-from oslo.db import options as db_options
+from oslo_db import concurrency as db_concurrency
+from oslo_db import options as db_options
db_opts = [
import threading
from oslo.config import cfg
-from oslo import db
+from oslo_db import options
from stevedore import driver
from cinder.db.sqlalchemy import api as db_api
_IMPL = None
_LOCK = threading.Lock()
-db.options.set_defaults(cfg.CONF)
+options.set_defaults(cfg.CONF)
MIGRATE_REPO_PATH = os.path.join(
os.path.abspath(os.path.dirname(__file__)),
import warnings
from oslo.config import cfg
-from oslo.db import exception as db_exc
-from oslo.db import options
-from oslo.db.sqlalchemy import session as db_session
from oslo.utils import timeutils
+from oslo_db import exception as db_exc
+from oslo_db import options
+from oslo_db.sqlalchemy import session as db_session
import osprofiler.sqlalchemy
import six
import sqlalchemy
"""
from oslo.config import cfg
-from oslo.db.sqlalchemy import models
from oslo.utils import timeutils
+from oslo_db.sqlalchemy import models
from sqlalchemy import Column, Integer, String, Text, schema
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import ForeignKey, DateTime, Boolean
# NOTE(jsbryant): When other oslo libraries switch over non-namespaced
# imports, we will need to add them to the regex below.
-oslo_namespace_imports = re.compile(r"from[\s]*oslo[.](concurrency)")
+oslo_namespace_imports = re.compile(r"from[\s]*oslo[.](concurrency|db)")
def no_vi_headers(physical_line, line_number, lines):
import random
from oslo.config import cfg
-from oslo.db import exception as db_exc
from oslo import messaging
from oslo.utils import importutils
from oslo_concurrency import processutils
+from oslo_db import exception as db_exc
import osprofiler.notifier
from osprofiler import profiler
import osprofiler.web
db_cmds.sync(version=version)
db_sync.assert_called_once_with(version)
- @mock.patch('oslo.db.sqlalchemy.migration.db_version')
+ @mock.patch('oslo_db.sqlalchemy.migration.db_version')
def test_db_commands_version(self, db_version):
db_cmds = cinder_manage.DbCommands()
db_cmds.version()
"from oslo.concurrency import foo"))))
self.assertEqual(0, len(list(checks.check_oslo_namespace_imports(
"from oslo_concurrency import bar"))))
+ self.assertEqual(1, len(list(checks.check_oslo_namespace_imports(
+ "from oslo.db import foo"))))
+ self.assertEqual(0, len(list(checks.check_oslo_namespace_imports(
+ "from oslo_db import bar"))))
from migrate.versioning import api as migration_api
from migrate.versioning import repository
-from oslo.db.sqlalchemy import test_base
-from oslo.db.sqlalchemy import test_migrations
-from oslo.db.sqlalchemy import utils as db_utils
+from oslo_db.sqlalchemy import test_base
+from oslo_db.sqlalchemy import test_migrations
+from oslo_db.sqlalchemy import utils as db_utils
import sqlalchemy
from cinder.db import migration
import time
-from oslo.db import exception as db_exc
+from oslo_db import exception as db_exc
from cinder import context
from cinder import db
import mock
import mox
from oslo.config import cfg
-from oslo.db import exception as db_exc
from oslo_concurrency import processutils
+from oslo_db import exception as db_exc
from cinder import context
from cinder import db
from oslo.config import cfg
-from oslo.db import exception as db_exc
+from oslo_db import exception as db_exc
from cinder import context
from cinder import db
from oslo.config import cfg
-from oslo.db import exception as db_exc
+from oslo_db import exception as db_exc
import six
from cinder import context