Merge pull request #2380 from coreos-inc/FIX-local-db-init
fix(initdb): local db init
This commit is contained in:
commit
254978c65b
1 changed files with 3 additions and 2 deletions
|
@ -836,12 +836,13 @@ if __name__ == '__main__':
|
||||||
parser.add_argument('--simple', action='store_true')
|
parser.add_argument('--simple', action='store_true')
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
log_level = getattr(logging, app.config['LOGGING_LEVEL'])
|
log_level = os.environ.get('LOGGING_LEVEL', getattr(logging, app.config['LOGGING_LEVEL']))
|
||||||
logging.basicConfig(level=log_level)
|
logging.basicConfig(level=log_level)
|
||||||
|
|
||||||
if not IS_TESTING_REAL_DATABASE and not isinstance(db.obj, SqliteDatabase):
|
if not IS_TESTING_REAL_DATABASE and not isinstance(db.obj, SqliteDatabase):
|
||||||
raise RuntimeError('Attempted to initialize production database!')
|
raise RuntimeError('Attempted to initialize production database!')
|
||||||
|
|
||||||
|
if os.environ.get('SKIP_DB_SCHEMA', '').lower() != 'true':
|
||||||
initialize_database()
|
initialize_database()
|
||||||
|
|
||||||
populate_database(args.simple)
|
populate_database(args.simple)
|
||||||
|
|
Reference in a new issue