Do not call setup_db from engine
Calling setup_db is creating the db structure if missing (because it's calling models.Workbook.metadata.create_all after). This is not what we want since we want the operator to manage the creation of the db using mistral-db-manage like any other regular openstack service. I suspect that this call was mostly useful for tests. This is a real issue in production because it create the DB structure without using the correct alembic migration path (and thus, alembic_version table is missing). Change-Id: I51f4128dd023846a4406cd1b414a56d741035483 Signed-off-by: Arnaud M <arnaud.morin@gmail.com>
This commit is contained in:
@@ -24,7 +24,6 @@ from mistral.api import access_control
|
|||||||
from mistral.api.hooks import maintenance
|
from mistral.api.hooks import maintenance
|
||||||
from mistral import config as m_config
|
from mistral import config as m_config
|
||||||
from mistral import context as ctx
|
from mistral import context as ctx
|
||||||
from mistral.db.v2 import api as db_api_v2
|
|
||||||
from mistral.rpc import base as rpc
|
from mistral.rpc import base as rpc
|
||||||
from mistral.services import periodic
|
from mistral.services import periodic
|
||||||
|
|
||||||
@@ -54,8 +53,6 @@ def setup_app(config=None):
|
|||||||
|
|
||||||
app_conf = dict(config.app)
|
app_conf = dict(config.app)
|
||||||
|
|
||||||
db_api_v2.setup_db()
|
|
||||||
|
|
||||||
# TODO(rakhmerov): Why do we run cron triggers in the API layer?
|
# TODO(rakhmerov): Why do we run cron triggers in the API layer?
|
||||||
# Should we move it to engine?s
|
# Should we move it to engine?s
|
||||||
if cfg.CONF.cron_trigger.enabled:
|
if cfg.CONF.cron_trigger.enabled:
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
|
|
||||||
from mistral import config as cfg
|
from mistral import config as cfg
|
||||||
from mistral.db.v2 import api as db_api
|
|
||||||
from mistral.engine import default_engine
|
from mistral.engine import default_engine
|
||||||
from mistral import exceptions as exc
|
from mistral import exceptions as exc
|
||||||
from mistral.rpc import base as rpc
|
from mistral.rpc import base as rpc
|
||||||
@@ -60,8 +59,6 @@ class EngineServer(service_base.MistralService):
|
|||||||
|
|
||||||
_validate_config()
|
_validate_config()
|
||||||
|
|
||||||
db_api.setup_db()
|
|
||||||
|
|
||||||
self._scheduler = sched_base.get_system_scheduler()
|
self._scheduler = sched_base.get_system_scheduler()
|
||||||
self._scheduler.start()
|
self._scheduler.start()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user