Set config file to db sync and other manage operation
Currently, the db sync operation does not specify the config dir or
config file.
If there is a config file in the home path, it will use this one,
but not the right one devstack write.
Set config file to these operations.
Change-Id: Id1fbc3d85280c19596f5ebd301c46bcf018fa2f6
Closes-Bug: #1578098
diff --git a/lib/cinder b/lib/cinder
index 607a6f8..daeb94a 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -415,7 +415,7 @@
recreate_database cinder
# Migrate cinder database
- $CINDER_BIN_DIR/cinder-manage db sync
+ $CINDER_BIN_DIR/cinder-manage --config-file $CINDER_CONF db sync
fi
if is_service_enabled c-vol && [[ -n "$CINDER_ENABLED_BACKENDS" ]]; then
diff --git a/lib/glance b/lib/glance
index cda357f..887a14d 100644
--- a/lib/glance
+++ b/lib/glance
@@ -334,10 +334,10 @@
recreate_database glance
# Migrate glance database
- $GLANCE_BIN_DIR/glance-manage db_sync
+ $GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_sync
# Load metadata definitions
- $GLANCE_BIN_DIR/glance-manage db_load_metadefs
+ $GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_load_metadefs
create_glance_cache_dir
}
diff --git a/lib/heat b/lib/heat
index 4326321..730adad 100644
--- a/lib/heat
+++ b/lib/heat
@@ -241,7 +241,7 @@
# (re)create heat database
recreate_database heat
- $HEAT_BIN_DIR/heat-manage db_sync
+ $HEAT_BIN_DIR/heat-manage --config-file $HEAT_CONF db_sync
create_heat_cache_dir
}
diff --git a/lib/keystone b/lib/keystone
index bcd5fab..6a202e5 100644
--- a/lib/keystone
+++ b/lib/keystone
@@ -489,16 +489,16 @@
recreate_database keystone
# Initialize keystone database
- $KEYSTONE_BIN_DIR/keystone-manage db_sync
+ $KEYSTONE_BIN_DIR/keystone-manage --config-file $KEYSTONE_CONF db_sync
if [[ "$KEYSTONE_TOKEN_FORMAT" == "pki" || "$KEYSTONE_TOKEN_FORMAT" == "pkiz" ]]; then
# Set up certificates
rm -rf $KEYSTONE_CONF_DIR/ssl
- $KEYSTONE_BIN_DIR/keystone-manage pki_setup
+ $KEYSTONE_BIN_DIR/keystone-manage --config-file $KEYSTONE_CONF pki_setup
fi
if [[ "$KEYSTONE_TOKEN_FORMAT" == "fernet" ]]; then
rm -rf "$KEYSTONE_CONF_DIR/fernet-keys/"
- $KEYSTONE_BIN_DIR/keystone-manage fernet_setup
+ $KEYSTONE_BIN_DIR/keystone-manage --config-file $KEYSTONE_CONF fernet_setup
fi
}
diff --git a/lib/nova b/lib/nova
index 818ecc4..7f64016 100644
--- a/lib/nova
+++ b/lib/nova
@@ -702,18 +702,18 @@
recreate_database nova
# Migrate nova database
- $NOVA_BIN_DIR/nova-manage db sync
+ $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync
if is_service_enabled n-cell; then
recreate_database $NOVA_CELLS_DB
fi
recreate_database $NOVA_API_DB
- $NOVA_BIN_DIR/nova-manage api_db sync
+ $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF api_db sync
# Run online migrations on the new databases
# Needed for flavor conversion
- $NOVA_BIN_DIR/nova-manage db online_data_migrations
+ $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db online_data_migrations
fi
create_nova_cache_dir