summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-04-07 17:46:50 +0000
committerGerrit Code Review <review@openstack.org>2023-04-07 17:46:50 +0000
commitcec8eb12c628a38b2431dac78ed37fc3f1506939 (patch)
treef613061baee36e32de818128e96f6d5742112585
parent1ca04117b9c3bff0b338df97df2c26d6a70929ea (diff)
parent43a5f3984e433ec28616cfe98cb060d9ff51af58 (diff)
downloadheat-cec8eb12c628a38b2431dac78ed37fc3f1506939.tar.gz
Merge "db: Remove layer of indirection"
-rw-r--r--heat/cmd/manage.py4
-rw-r--r--heat/common/context.py3
-rw-r--r--heat/db/alembic.ini (renamed from heat/db/sqlalchemy/alembic.ini)4
-rw-r--r--heat/db/api.py (renamed from heat/db/sqlalchemy/api.py)6
-rw-r--r--heat/db/filters.py (renamed from heat/db/sqlalchemy/filters.py)0
-rw-r--r--heat/db/migration.py (renamed from heat/db/sqlalchemy/migration.py)2
-rw-r--r--heat/db/migrations/README.rst (renamed from heat/db/sqlalchemy/migrations/README.rst)0
-rw-r--r--heat/db/migrations/env.py (renamed from heat/db/sqlalchemy/migrations/env.py)2
-rw-r--r--heat/db/migrations/script.py.mako (renamed from heat/db/sqlalchemy/migrations/script.py.mako)0
-rw-r--r--heat/db/migrations/versions/c6214ca60943_initial_revision.py (renamed from heat/db/sqlalchemy/migrations/versions/c6214ca60943_initial_revision.py)32
-rw-r--r--heat/db/models.py (renamed from heat/db/sqlalchemy/models.py)2
-rw-r--r--heat/db/sqlalchemy/__init__.py0
-rw-r--r--heat/db/types.py (renamed from heat/db/sqlalchemy/types.py)0
-rw-r--r--heat/db/utils.py (renamed from heat/db/sqlalchemy/utils.py)0
-rw-r--r--heat/engine/service_software_config.py2
-rw-r--r--heat/engine/template_files.py2
-rw-r--r--heat/engine/worker.py2
-rw-r--r--heat/objects/event.py2
-rw-r--r--heat/objects/raw_template.py2
-rw-r--r--heat/objects/raw_template_files.py2
-rw-r--r--heat/objects/resource.py2
-rw-r--r--heat/objects/resource_data.py2
-rw-r--r--heat/objects/resource_properties_data.py2
-rw-r--r--heat/objects/service.py2
-rw-r--r--heat/objects/snapshot.py2
-rw-r--r--heat/objects/software_config.py3
-rw-r--r--heat/objects/software_deployment.py2
-rw-r--r--heat/objects/stack.py2
-rw-r--r--heat/objects/stack_lock.py3
-rw-r--r--heat/objects/stack_tag.py2
-rw-r--r--heat/objects/sync_point.py4
-rw-r--r--heat/objects/user_creds.py2
-rw-r--r--heat/tests/convergence/framework/engine_wrapper.py2
-rw-r--r--heat/tests/convergence/framework/reality.py2
-rw-r--r--heat/tests/db/test_migrations.py4
-rw-r--r--heat/tests/db/test_sqlalchemy_api.py6
-rw-r--r--heat/tests/db/test_sqlalchemy_filters.py2
-rw-r--r--heat/tests/db/test_sqlalchemy_types.py2
-rw-r--r--heat/tests/engine/service/test_software_config.py2
-rw-r--r--heat/tests/engine/service/test_stack_update.py2
-rw-r--r--heat/tests/engine/test_engine_worker.py2
-rw-r--r--heat/tests/test_common_service_utils.py2
-rw-r--r--heat/tests/test_engine_api_utils.py2
-rw-r--r--heat/tests/test_event.py2
-rw-r--r--heat/tests/test_resource.py4
-rw-r--r--heat/tests/test_resource_properties_data.py2
-rw-r--r--heat/tests/test_signal.py2
-rw-r--r--heat/tests/test_stack.py2
-rw-r--r--heat/tests/test_stack_update.py2
-rw-r--r--heat/tests/utils.py4
50 files changed, 68 insertions, 73 deletions
diff --git a/heat/cmd/manage.py b/heat/cmd/manage.py
index 9f7b8e316..870c95d1d 100644
--- a/heat/cmd/manage.py
+++ b/heat/cmd/manage.py
@@ -25,8 +25,8 @@ from heat.common import exception
from heat.common.i18n import _
from heat.common import messaging
from heat.common import service_utils
-from heat.db.sqlalchemy import api as db_api
-from heat.db.sqlalchemy import migration as db_migration
+from heat.db import api as db_api
+from heat.db import migration as db_migration
from heat.objects import service as service_objects
from heat.rpc import client as rpc_client
from heat import version
diff --git a/heat/common/context.py b/heat/common/context.py
index c72c8367b..854c13467 100644
--- a/heat/common/context.py
+++ b/heat/common/context.py
@@ -31,12 +31,11 @@ from heat.common import endpoint_utils
from heat.common import exception
from heat.common import policy
from heat.common import wsgi
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.engine import clients
LOG = logging.getLogger(__name__)
-
cfg.CONF.import_opt('client_retry_limit', 'heat.common.config')
# Note, we yield the options via list_opts to enable generation of the
diff --git a/heat/db/sqlalchemy/alembic.ini b/heat/db/alembic.ini
index b4a2f235a..dbee79a3b 100644
--- a/heat/db/sqlalchemy/alembic.ini
+++ b/heat/db/alembic.ini
@@ -7,10 +7,10 @@ script_location = %(here)s/migrations
prepend_sys_path = .
# version location specification; This defaults
-# to heat/db/sqlalchemy/migrations/versions. When using multiple version
+# to heat/db/migrations/versions. When using multiple version
# directories, initial revisions must be specified with --version-path.
# The path separator used here should be the separator specified by "version_path_separator" below.
-# version_locations = %(here)s/bar:%(here)s/bat:heat/db/sqlalchemy/migrations/versions
+# version_locations = %(here)s/bar:%(here)s/bat:heat/db/migrations/versions
# version path separator; As mentioned above, this is the character used to split
# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep.
diff --git a/heat/db/sqlalchemy/api.py b/heat/db/api.py
index 1556d2d76..8b2c99967 100644
--- a/heat/db/sqlalchemy/api.py
+++ b/heat/db/api.py
@@ -38,9 +38,9 @@ from sqlalchemy.orm import aliased as orm_aliased
from heat.common import crypt
from heat.common import exception
from heat.common.i18n import _
-from heat.db.sqlalchemy import filters as db_filters
-from heat.db.sqlalchemy import models
-from heat.db.sqlalchemy import utils as db_utils
+from heat.db import filters as db_filters
+from heat.db import models
+from heat.db import utils as db_utils
from heat.engine import environment as heat_environment
from heat.rpc import api as rpc_api
diff --git a/heat/db/sqlalchemy/filters.py b/heat/db/filters.py
index 6c7b8cf24..6c7b8cf24 100644
--- a/heat/db/sqlalchemy/filters.py
+++ b/heat/db/filters.py
diff --git a/heat/db/sqlalchemy/migration.py b/heat/db/migration.py
index 67ac4c3b4..910656ca1 100644
--- a/heat/db/sqlalchemy/migration.py
+++ b/heat/db/migration.py
@@ -18,7 +18,7 @@ from alembic import migration as alembic_migration
from oslo_log import log as logging
import sqlalchemy as sa
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
LOG = logging.getLogger(__name__)
diff --git a/heat/db/sqlalchemy/migrations/README.rst b/heat/db/migrations/README.rst
index b2283fc82..b2283fc82 100644
--- a/heat/db/sqlalchemy/migrations/README.rst
+++ b/heat/db/migrations/README.rst
diff --git a/heat/db/sqlalchemy/migrations/env.py b/heat/db/migrations/env.py
index 84413f313..932b16a97 100644
--- a/heat/db/sqlalchemy/migrations/env.py
+++ b/heat/db/migrations/env.py
@@ -16,7 +16,7 @@ from alembic import context
from sqlalchemy import engine_from_config
from sqlalchemy import pool
-from heat.db.sqlalchemy import models
+from heat.db import models
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
diff --git a/heat/db/sqlalchemy/migrations/script.py.mako b/heat/db/migrations/script.py.mako
index 120937fbc..120937fbc 100644
--- a/heat/db/sqlalchemy/migrations/script.py.mako
+++ b/heat/db/migrations/script.py.mako
diff --git a/heat/db/sqlalchemy/migrations/versions/c6214ca60943_initial_revision.py b/heat/db/migrations/versions/c6214ca60943_initial_revision.py
index b6a4e7bbc..d3e9d757d 100644
--- a/heat/db/sqlalchemy/migrations/versions/c6214ca60943_initial_revision.py
+++ b/heat/db/migrations/versions/c6214ca60943_initial_revision.py
@@ -20,7 +20,7 @@ Create Date: 2023-03-22 18:04:02.387269
from alembic import op
import sqlalchemy as sa
-import heat.db.sqlalchemy.types
+import heat.db.types
# revision identifiers, used by Alembic.
revision = 'c6214ca60943'
@@ -33,7 +33,7 @@ def upgrade() -> None:
op.create_table(
'raw_template_files',
sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('files', heat.db.sqlalchemy.types.Json(), nullable=True),
+ sa.Column('files', heat.db.types.Json(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.PrimaryKeyConstraint('id'),
@@ -42,7 +42,7 @@ def upgrade() -> None:
op.create_table(
'resource_properties_data',
sa.Column('id', sa.Integer(), nullable=False),
- sa.Column('data', heat.db.sqlalchemy.types.Json(), nullable=True),
+ sa.Column('data', heat.db.types.Json(), nullable=True),
sa.Column('encrypted', sa.Boolean(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
@@ -71,7 +71,7 @@ def upgrade() -> None:
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.Column('name', sa.String(length=255), nullable=True),
sa.Column('group', sa.String(length=255), nullable=True),
- sa.Column('config', heat.db.sqlalchemy.types.Json(), nullable=True),
+ sa.Column('config', heat.db.types.Json(), nullable=True),
sa.Column('tenant', sa.String(length=64), nullable=False),
sa.PrimaryKeyConstraint('id'),
mysql_engine='InnoDB',
@@ -104,10 +104,10 @@ def upgrade() -> None:
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
- sa.Column('template', heat.db.sqlalchemy.types.Json(), nullable=True),
- sa.Column('files', heat.db.sqlalchemy.types.Json(), nullable=True),
+ sa.Column('template', heat.db.types.Json(), nullable=True),
+ sa.Column('files', heat.db.types.Json(), nullable=True),
sa.Column(
- 'environment', heat.db.sqlalchemy.types.Json(), nullable=True
+ 'environment', heat.db.types.Json(), nullable=True
),
sa.Column('files_id', sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(
@@ -126,10 +126,10 @@ def upgrade() -> None:
sa.Column('server_id', sa.String(length=36), nullable=False),
sa.Column('config_id', sa.String(length=36), nullable=False),
sa.Column(
- 'input_values', heat.db.sqlalchemy.types.Json(), nullable=True
+ 'input_values', heat.db.types.Json(), nullable=True
),
sa.Column(
- 'output_values', heat.db.sqlalchemy.types.Json(), nullable=True
+ 'output_values', heat.db.types.Json(), nullable=True
),
sa.Column('action', sa.String(length=255), nullable=True),
sa.Column('status', sa.String(length=255), nullable=True),
@@ -188,7 +188,7 @@ def upgrade() -> None:
sa.Column('convergence', sa.Boolean(), nullable=True),
sa.Column('current_traversal', sa.String(length=36), nullable=True),
sa.Column(
- 'current_deps', heat.db.sqlalchemy.types.Json(), nullable=True
+ 'current_deps', heat.db.types.Json(), nullable=True
),
sa.Column(
'parent_resource_name', sa.String(length=255), nullable=True
@@ -261,15 +261,15 @@ def upgrade() -> None:
sa.Column('status_reason', sa.Text(), nullable=True),
sa.Column('stack_id', sa.String(length=36), nullable=False),
sa.Column(
- 'rsrc_metadata', heat.db.sqlalchemy.types.Json(), nullable=True
+ 'rsrc_metadata', heat.db.types.Json(), nullable=True
),
sa.Column(
- 'properties_data', heat.db.sqlalchemy.types.Json(), nullable=True
+ 'properties_data', heat.db.types.Json(), nullable=True
),
sa.Column('engine_id', sa.String(length=36), nullable=True),
sa.Column('atomic_key', sa.Integer(), nullable=True),
- sa.Column('needed_by', heat.db.sqlalchemy.types.List(), nullable=True),
- sa.Column('requires', heat.db.sqlalchemy.types.List(), nullable=True),
+ sa.Column('needed_by', heat.db.types.List(), nullable=True),
+ sa.Column('requires', heat.db.types.List(), nullable=True),
sa.Column('replaces', sa.Integer(), nullable=True),
sa.Column('replaced_by', sa.Integer(), nullable=True),
sa.Column('current_template_id', sa.Integer(), nullable=True),
@@ -314,7 +314,7 @@ def upgrade() -> None:
sa.Column('updated_at', sa.DateTime(), nullable=True),
sa.Column('status', sa.String(length=255), nullable=True),
sa.Column('status_reason', sa.String(length=255), nullable=True),
- sa.Column('data', heat.db.sqlalchemy.types.Json(), nullable=True),
+ sa.Column('data', heat.db.types.Json(), nullable=True),
sa.Column('tenant', sa.String(length=64), nullable=False),
sa.ForeignKeyConstraint(
['stack_id'],
@@ -361,7 +361,7 @@ def upgrade() -> None:
sa.Column('atomic_key', sa.Integer(), nullable=False),
sa.Column('stack_id', sa.String(length=36), nullable=False),
sa.Column(
- 'input_data', heat.db.sqlalchemy.types.Json(), nullable=True
+ 'input_data', heat.db.types.Json(), nullable=True
),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('updated_at', sa.DateTime(), nullable=True),
diff --git a/heat/db/sqlalchemy/models.py b/heat/db/models.py
index ca208bef0..ebc235f5d 100644
--- a/heat/db/sqlalchemy/models.py
+++ b/heat/db/models.py
@@ -21,7 +21,7 @@ from sqlalchemy.ext import declarative
from sqlalchemy.orm import backref
from sqlalchemy.orm import relationship
-from heat.db.sqlalchemy import types
+from heat.db import types
BASE = declarative.declarative_base()
diff --git a/heat/db/sqlalchemy/__init__.py b/heat/db/sqlalchemy/__init__.py
deleted file mode 100644
index e69de29bb..000000000
--- a/heat/db/sqlalchemy/__init__.py
+++ /dev/null
diff --git a/heat/db/sqlalchemy/types.py b/heat/db/types.py
index d454024c6..d454024c6 100644
--- a/heat/db/sqlalchemy/types.py
+++ b/heat/db/types.py
diff --git a/heat/db/sqlalchemy/utils.py b/heat/db/utils.py
index 67e2d541e..67e2d541e 100644
--- a/heat/db/sqlalchemy/utils.py
+++ b/heat/db/utils.py
diff --git a/heat/engine/service_software_config.py b/heat/engine/service_software_config.py
index 637d7874e..195397101 100644
--- a/heat/engine/service_software_config.py
+++ b/heat/engine/service_software_config.py
@@ -23,7 +23,7 @@ from urllib import parse
from heat.common import crypt
from heat.common import exception
from heat.common.i18n import _
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.engine import api
from heat.engine import resource
from heat.engine import scheduler
diff --git a/heat/engine/template_files.py b/heat/engine/template_files.py
index 55a54e0d6..bcbe68b07 100644
--- a/heat/engine/template_files.py
+++ b/heat/engine/template_files.py
@@ -17,7 +17,7 @@ import weakref
from heat.common import context
from heat.common import exception
from heat.common.i18n import _
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import raw_template_files
_d = weakref.WeakValueDictionary()
diff --git a/heat/engine/worker.py b/heat/engine/worker.py
index 28e2424e0..c2163ff59 100644
--- a/heat/engine/worker.py
+++ b/heat/engine/worker.py
@@ -24,7 +24,7 @@ from osprofiler import profiler
from heat.common import context
from heat.common import messaging as rpc_messaging
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.engine import check_resource
from heat.engine import node_data
from heat.engine import stack as parser
diff --git a/heat/objects/event.py b/heat/objects/event.py
index f51a6ac8b..c9a356e97 100644
--- a/heat/objects/event.py
+++ b/heat/objects/event.py
@@ -19,7 +19,7 @@ from oslo_versionedobjects import base
from oslo_versionedobjects import fields
from heat.common import identifier
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
from heat.objects import resource_properties_data as rpd
diff --git a/heat/objects/raw_template.py b/heat/objects/raw_template.py
index 3a1ba35db..616411247 100644
--- a/heat/objects/raw_template.py
+++ b/heat/objects/raw_template.py
@@ -24,7 +24,7 @@ from oslo_versionedobjects import fields
from heat.common import crypt
from heat.common import environment_format as env_fmt
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
from heat.objects import fields as heat_fields
diff --git a/heat/objects/raw_template_files.py b/heat/objects/raw_template_files.py
index 1afed6e7e..36d6cde91 100644
--- a/heat/objects/raw_template_files.py
+++ b/heat/objects/raw_template_files.py
@@ -16,7 +16,7 @@
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
from heat.objects import fields as heat_fields
diff --git a/heat/objects/resource.py b/heat/objects/resource.py
index c5aacd4fc..590ea5a59 100644
--- a/heat/objects/resource.py
+++ b/heat/objects/resource.py
@@ -26,7 +26,7 @@ import tenacity
from heat.common import crypt
from heat.common import exception
from heat.common.i18n import _
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
from heat.objects import fields as heat_fields
from heat.objects import resource_data
diff --git a/heat/objects/resource_data.py b/heat/objects/resource_data.py
index 4b6419bcc..7602bc040 100644
--- a/heat/objects/resource_data.py
+++ b/heat/objects/resource_data.py
@@ -19,7 +19,7 @@ from oslo_versionedobjects import base
from oslo_versionedobjects import fields
from heat.common import exception
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
diff --git a/heat/objects/resource_properties_data.py b/heat/objects/resource_properties_data.py
index c1c313c25..4b6a18dad 100644
--- a/heat/objects/resource_properties_data.py
+++ b/heat/objects/resource_properties_data.py
@@ -19,7 +19,7 @@ from oslo_versionedobjects import base
from oslo_versionedobjects import fields
from heat.common import crypt
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import fields as heat_fields
diff --git a/heat/objects/service.py b/heat/objects/service.py
index 416e9081c..121af6145 100644
--- a/heat/objects/service.py
+++ b/heat/objects/service.py
@@ -18,7 +18,7 @@ from oslo_versionedobjects import base
from oslo_versionedobjects import fields
from heat.common import service_utils
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
diff --git a/heat/objects/snapshot.py b/heat/objects/snapshot.py
index 95c758d05..23d569a40 100644
--- a/heat/objects/snapshot.py
+++ b/heat/objects/snapshot.py
@@ -18,7 +18,7 @@
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
from heat.objects import fields as heat_fields
diff --git a/heat/objects/software_config.py b/heat/objects/software_config.py
index 02ac8a908..e0d9d42c7 100644
--- a/heat/objects/software_config.py
+++ b/heat/objects/software_config.py
@@ -12,13 +12,12 @@
# License for the specific language governing permissions and limitations
# under the License.
-
"""SoftwareConfig object."""
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
from heat.objects import fields as heat_fields
diff --git a/heat/objects/software_deployment.py b/heat/objects/software_deployment.py
index 2ff47ad93..564a48465 100644
--- a/heat/objects/software_deployment.py
+++ b/heat/objects/software_deployment.py
@@ -18,7 +18,7 @@
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
from heat.objects import fields as heat_fields
from heat.objects import software_config
diff --git a/heat/objects/stack.py b/heat/objects/stack.py
index 349aaada8..a5c781d16 100644
--- a/heat/objects/stack.py
+++ b/heat/objects/stack.py
@@ -22,7 +22,7 @@ from oslo_versionedobjects import fields
from heat.common import exception
from heat.common.i18n import _
from heat.common import identifier
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
from heat.objects import fields as heat_fields
from heat.objects import raw_template
diff --git a/heat/objects/stack_lock.py b/heat/objects/stack_lock.py
index 1a00c40e9..9d699ee00 100644
--- a/heat/objects/stack_lock.py
+++ b/heat/objects/stack_lock.py
@@ -11,13 +11,12 @@
# License for the specific language governing permissions and limitations
# under the License.
-
"""StackLock object."""
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
diff --git a/heat/objects/stack_tag.py b/heat/objects/stack_tag.py
index 3a75fffbf..50d86deda 100644
--- a/heat/objects/stack_tag.py
+++ b/heat/objects/stack_tag.py
@@ -17,7 +17,7 @@
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
diff --git a/heat/objects/sync_point.py b/heat/objects/sync_point.py
index 264d323b8..750a551b1 100644
--- a/heat/objects/sync_point.py
+++ b/heat/objects/sync_point.py
@@ -11,14 +11,12 @@
# License for the specific language governing permissions and limitations
# under the License.
-
"""SyncPoint object."""
-
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
from heat.objects import fields as heat_fields
diff --git a/heat/objects/user_creds.py b/heat/objects/user_creds.py
index abfa3610a..d482ee229 100644
--- a/heat/objects/user_creds.py
+++ b/heat/objects/user_creds.py
@@ -18,7 +18,7 @@
from oslo_versionedobjects import base
from oslo_versionedobjects import fields
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.objects import base as heat_base
diff --git a/heat/tests/convergence/framework/engine_wrapper.py b/heat/tests/convergence/framework/engine_wrapper.py
index b1dc5e6b4..c1fb47c01 100644
--- a/heat/tests/convergence/framework/engine_wrapper.py
+++ b/heat/tests/convergence/framework/engine_wrapper.py
@@ -11,7 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.engine import service
from heat.engine import stack
from heat.tests.convergence.framework import message_processor
diff --git a/heat/tests/convergence/framework/reality.py b/heat/tests/convergence/framework/reality.py
index 055782b38..0618c758d 100644
--- a/heat/tests/convergence/framework/reality.py
+++ b/heat/tests/convergence/framework/reality.py
@@ -14,7 +14,7 @@
from unittest import mock
from heat.common import exception
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.tests import utils
diff --git a/heat/tests/db/test_migrations.py b/heat/tests/db/test_migrations.py
index b627e963e..ffad49f2e 100644
--- a/heat/tests/db/test_migrations.py
+++ b/heat/tests/db/test_migrations.py
@@ -22,8 +22,8 @@ from oslotest import base as test_base
import sqlalchemy
import testtools
-from heat.db.sqlalchemy import migration
-from heat.db.sqlalchemy import models
+from heat.db import migration
+from heat.db import models
class DBNotAllowed(Exception):
diff --git a/heat/tests/db/test_sqlalchemy_api.py b/heat/tests/db/test_sqlalchemy_api.py
index 07a1c2670..a4f3309f0 100644
--- a/heat/tests/db/test_sqlalchemy_api.py
+++ b/heat/tests/db/test_sqlalchemy_api.py
@@ -30,8 +30,8 @@ from heat.common import context
from heat.common import exception
from heat.common import short_id
from heat.common import template_format
-from heat.db.sqlalchemy import api as db_api
-from heat.db.sqlalchemy import models
+from heat.db import api as db_api
+from heat.db import models
from heat.engine.clients.os import glance
from heat.engine.clients.os import nova
from heat.engine import environment
@@ -2308,7 +2308,7 @@ class DBAPIStackTest(common.HeatTestCase):
create_stack(self.ctx, self.template, self.user_creds,
deleted_at=deleted)
- with mock.patch('heat.db.sqlalchemy.api._purge_stacks') as mock_ps:
+ with mock.patch('heat.db.api._purge_stacks') as mock_ps:
db_api.purge_deleted(age=0, batch_size=2)
self.assertEqual(4, mock_ps.call_count)
diff --git a/heat/tests/db/test_sqlalchemy_filters.py b/heat/tests/db/test_sqlalchemy_filters.py
index e3424aee7..6e8f2d312 100644
--- a/heat/tests/db/test_sqlalchemy_filters.py
+++ b/heat/tests/db/test_sqlalchemy_filters.py
@@ -13,7 +13,7 @@
from unittest import mock
-from heat.db.sqlalchemy import filters as db_filters
+from heat.db import filters as db_filters
from heat.tests import common
diff --git a/heat/tests/db/test_sqlalchemy_types.py b/heat/tests/db/test_sqlalchemy_types.py
index 47b460a55..051962d18 100644
--- a/heat/tests/db/test_sqlalchemy_types.py
+++ b/heat/tests/db/test_sqlalchemy_types.py
@@ -15,7 +15,7 @@ from sqlalchemy.dialects.mysql import base as mysql_base
from sqlalchemy.dialects.sqlite import base as sqlite_base
from sqlalchemy import types
-from heat.db.sqlalchemy import types as db_types
+from heat.db import types as db_types
from heat.tests import common
diff --git a/heat/tests/engine/service/test_software_config.py b/heat/tests/engine/service/test_software_config.py
index ecd7bef62..9aba366a5 100644
--- a/heat/tests/engine/service/test_software_config.py
+++ b/heat/tests/engine/service/test_software_config.py
@@ -22,7 +22,7 @@ from oslo_utils import timeutils
from heat.common import crypt
from heat.common import exception
from heat.common import template_format
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.engine.clients.os import swift
from heat.engine.clients.os import zaqar
from heat.engine import service
diff --git a/heat/tests/engine/service/test_stack_update.py b/heat/tests/engine/service/test_stack_update.py
index f1df832af..0712e888f 100644
--- a/heat/tests/engine/service/test_stack_update.py
+++ b/heat/tests/engine/service/test_stack_update.py
@@ -24,7 +24,7 @@ from heat.common import exception
from heat.common import messaging
from heat.common import service_utils
from heat.common import template_format
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.engine.clients.os import glance
from heat.engine.clients.os import nova
from heat.engine.clients.os import swift
diff --git a/heat/tests/engine/test_engine_worker.py b/heat/tests/engine/test_engine_worker.py
index 0eed84fb0..de873b2aa 100644
--- a/heat/tests/engine/test_engine_worker.py
+++ b/heat/tests/engine/test_engine_worker.py
@@ -15,7 +15,7 @@
from unittest import mock
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.engine import check_resource
from heat.engine import stack as parser
from heat.engine import template as templatem
diff --git a/heat/tests/test_common_service_utils.py b/heat/tests/test_common_service_utils.py
index 0745e8f85..2b363607c 100644
--- a/heat/tests/test_common_service_utils.py
+++ b/heat/tests/test_common_service_utils.py
@@ -18,7 +18,7 @@ from oslo_utils import timeutils
import uuid
from heat.common import service_utils
-from heat.db.sqlalchemy import models
+from heat.db import models
from heat.tests import common
diff --git a/heat/tests/test_engine_api_utils.py b/heat/tests/test_engine_api_utils.py
index 8703fcdda..6cee13b03 100644
--- a/heat/tests/test_engine_api_utils.py
+++ b/heat/tests/test_engine_api_utils.py
@@ -21,7 +21,7 @@ from oslo_utils import timeutils
from heat.common import exception
from heat.common import template_format
from heat.common import timeutils as heat_timeutils
-from heat.db.sqlalchemy import models
+from heat.db import models
from heat.engine import api
from heat.engine.cfn import parameters as cfn_param
from heat.engine import event
diff --git a/heat/tests/test_event.py b/heat/tests/test_event.py
index 8d9a2521b..0efdf9caf 100644
--- a/heat/tests/test_event.py
+++ b/heat/tests/test_event.py
@@ -16,7 +16,7 @@ from unittest import mock
from oslo_config import cfg
import uuid
-from heat.db.sqlalchemy import models
+from heat.db import models
from heat.engine import event
from heat.engine import stack
from heat.engine import template
diff --git a/heat/tests/test_resource.py b/heat/tests/test_resource.py
index b4f8f05c0..e3d0c97ef 100644
--- a/heat/tests/test_resource.py
+++ b/heat/tests/test_resource.py
@@ -27,8 +27,8 @@ from heat.common import exception
from heat.common.i18n import _
from heat.common import short_id
from heat.common import timeutils
-from heat.db.sqlalchemy import api as db_api
-from heat.db.sqlalchemy import models
+from heat.db import api as db_api
+from heat.db import models
from heat.engine import attributes
from heat.engine.cfn import functions as cfn_funcs
from heat.engine import clients
diff --git a/heat/tests/test_resource_properties_data.py b/heat/tests/test_resource_properties_data.py
index 2ef5374cf..bcf677564 100644
--- a/heat/tests/test_resource_properties_data.py
+++ b/heat/tests/test_resource_properties_data.py
@@ -13,7 +13,7 @@
from oslo_config import cfg
-from heat.db.sqlalchemy import models
+from heat.db import models
from heat.objects import resource_properties_data as rpd_object
from heat.tests import common
from heat.tests import utils
diff --git a/heat/tests/test_signal.py b/heat/tests/test_signal.py
index bb0b8313b..b2d754abb 100644
--- a/heat/tests/test_signal.py
+++ b/heat/tests/test_signal.py
@@ -20,7 +20,7 @@ from oslo_utils import timeutils
from heat.common import exception
from heat.common import template_format
-from heat.db.sqlalchemy import models
+from heat.db import models
from heat.engine.clients.os import heat_plugin
from heat.engine.clients.os.keystone import fake_keystoneclient as fake_ks
from heat.engine.clients.os import swift
diff --git a/heat/tests/test_stack.py b/heat/tests/test_stack.py
index 35374190c..278df8e23 100644
--- a/heat/tests/test_stack.py
+++ b/heat/tests/test_stack.py
@@ -27,7 +27,7 @@ from heat.common import context
from heat.common import exception
from heat.common import template_format
from heat.common import timeutils
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.engine.clients.os import keystone
from heat.engine.clients.os.keystone import fake_keystoneclient as fake_ks
from heat.engine.clients.os import nova
diff --git a/heat/tests/test_stack_update.py b/heat/tests/test_stack_update.py
index a466cef4f..b441f3ebf 100644
--- a/heat/tests/test_stack_update.py
+++ b/heat/tests/test_stack_update.py
@@ -17,7 +17,7 @@ from unittest import mock
from heat.common import exception
from heat.common import template_format
-from heat.db.sqlalchemy import api as db_api
+from heat.db import api as db_api
from heat.engine.clients.os.keystone import fake_keystoneclient
from heat.engine import environment
from heat.engine import resource
diff --git a/heat/tests/utils.py b/heat/tests/utils.py
index ea9aa6329..44c81c294 100644
--- a/heat/tests/utils.py
+++ b/heat/tests/utils.py
@@ -24,8 +24,8 @@ import sqlalchemy
from sqlalchemy import exc as sqla_exc
from heat.common import context
-from heat.db.sqlalchemy import api as db_api
-from heat.db.sqlalchemy import models
+from heat.db import api as db_api
+from heat.db import models
from heat.engine import environment
from heat.engine import node_data
from heat.engine import resource