Fix db management: don't autocreate db on start
We should use sahara-db-manage for db creation instead of auto created db schema from metadata. This approach was applied by adding support for alembic-based migrations and db autocreation code was removed in I14a0602bb34bf09086428766cb681345191436fe, but it one more place where we're autocreating db was missed, so, it's a fix for this issue. Additionally, cleanup custom hacking check for sahara.db calls. Docs already contains notes about need for using sahara-db-manage for database creation. Note: The main driver in fixing this right now is that if a user create database from metadata, he will not be able to migrate from Icehouse to Juno. Only databases created by alembic could be migrated to the later version. Closes-Bug: #1300190 Change-Id: I991aa3402f658999735ad9607544251a6ef0e122
This commit is contained in:
parent
05990416e2
commit
c7a009805e
|
@ -38,7 +38,6 @@ gettext.install('sahara', unicode=1)
|
|||
|
||||
|
||||
from sahara import config
|
||||
from sahara.db import api as db_api
|
||||
import sahara.main as server
|
||||
from sahara.openstack.common import log as logging
|
||||
|
||||
|
@ -58,9 +57,6 @@ def main():
|
|||
config.parse_configs(sys.argv[1:], config_files)
|
||||
logging.setup("sahara")
|
||||
|
||||
if not db_api.setup_db():
|
||||
raise RuntimeError('Failed to create database!')
|
||||
|
||||
app = server.make_app()
|
||||
|
||||
wsgi.server(eventlet.listen((cfg.CONF.host, cfg.CONF.port), backlog=500),
|
||||
|
|
|
@ -39,9 +39,7 @@ def import_db_only_in_conductor(logical_line, filename):
|
|||
if _any_in(filename,
|
||||
"sahara/conductor",
|
||||
"sahara/tests",
|
||||
"sahara/db",
|
||||
"sahara/main.py",
|
||||
"sahara/cli"):
|
||||
"sahara/db"):
|
||||
return
|
||||
|
||||
if _starts_with_any(logical_line,
|
||||
|
|
Loading…
Reference in New Issue