From 3f683abe603985ea35cff67c372c3c8767ac9045 Mon Sep 17 00:00:00 2001 From: rabi Date: Fri, 11 Nov 2016 14:07:20 +0530 Subject: [PATCH] Recreate db only if db service is enabled When setting up additional devstack instances with heat, don't recreate the database and do db_sync, as it would point to some existing database. Change-Id: I65fb33b0ad69bc4e5ff390e2b110779178b957ce --- devstack/lib/heat | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/devstack/lib/heat b/devstack/lib/heat index 08c9ec0b32..c3bd16102c 100644 --- a/devstack/lib/heat +++ b/devstack/lib/heat @@ -242,11 +242,12 @@ function configure_heat { # init_heat() - Initialize database function init_heat { - - # (re)create heat database - recreate_database heat - - $HEAT_BIN_DIR/heat-manage db_sync + # recreate db only if one of the db services is enabled + if is_service_enabled $DATABASE_BACKENDS; then + # (re)create heat database + recreate_database heat + $HEAT_BIN_DIR/heat-manage db_sync + fi create_heat_cache_dir }