Browse code

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

Einst Crazy authored on 2016/05/04 17:14:01
Showing 5 changed files
... ...
@@ -415,7 +415,7 @@ function init_cinder {
415 415
         recreate_database cinder
416 416
 
417 417
         # Migrate cinder database
418
-        $CINDER_BIN_DIR/cinder-manage db sync
418
+        $CINDER_BIN_DIR/cinder-manage --config-file $CINDER_CONF db sync
419 419
     fi
420 420
 
421 421
     if is_service_enabled c-vol && [[ -n "$CINDER_ENABLED_BACKENDS" ]]; then
... ...
@@ -334,10 +334,10 @@ function init_glance {
334 334
     recreate_database glance
335 335
 
336 336
     # Migrate glance database
337
-    $GLANCE_BIN_DIR/glance-manage db_sync
337
+    $GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_sync
338 338
 
339 339
     # Load metadata definitions
340
-    $GLANCE_BIN_DIR/glance-manage db_load_metadefs
340
+    $GLANCE_BIN_DIR/glance-manage --config-file $GLANCE_CONF_DIR/glance-api.conf db_load_metadefs
341 341
 
342 342
     create_glance_cache_dir
343 343
 }
... ...
@@ -241,7 +241,7 @@ function init_heat {
241 241
     # (re)create heat database
242 242
     recreate_database heat
243 243
 
244
-    $HEAT_BIN_DIR/heat-manage db_sync
244
+    $HEAT_BIN_DIR/heat-manage --config-file $HEAT_CONF db_sync
245 245
     create_heat_cache_dir
246 246
 }
247 247
 
... ...
@@ -489,16 +489,16 @@ function init_keystone {
489 489
     recreate_database keystone
490 490
 
491 491
     # Initialize keystone database
492
-    $KEYSTONE_BIN_DIR/keystone-manage db_sync
492
+    $KEYSTONE_BIN_DIR/keystone-manage --config-file $KEYSTONE_CONF db_sync
493 493
 
494 494
     if [[ "$KEYSTONE_TOKEN_FORMAT" == "pki" || "$KEYSTONE_TOKEN_FORMAT" == "pkiz" ]]; then
495 495
         # Set up certificates
496 496
         rm -rf $KEYSTONE_CONF_DIR/ssl
497
-        $KEYSTONE_BIN_DIR/keystone-manage pki_setup
497
+        $KEYSTONE_BIN_DIR/keystone-manage --config-file $KEYSTONE_CONF pki_setup
498 498
     fi
499 499
     if [[ "$KEYSTONE_TOKEN_FORMAT" == "fernet" ]]; then
500 500
         rm -rf "$KEYSTONE_CONF_DIR/fernet-keys/"
501
-        $KEYSTONE_BIN_DIR/keystone-manage fernet_setup
501
+        $KEYSTONE_BIN_DIR/keystone-manage --config-file $KEYSTONE_CONF fernet_setup
502 502
     fi
503 503
 }
504 504
 
... ...
@@ -702,18 +702,18 @@ function init_nova {
702 702
         recreate_database nova
703 703
 
704 704
         # Migrate nova database
705
-        $NOVA_BIN_DIR/nova-manage db sync
705
+        $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db sync
706 706
 
707 707
         if is_service_enabled n-cell; then
708 708
             recreate_database $NOVA_CELLS_DB
709 709
         fi
710 710
 
711 711
         recreate_database $NOVA_API_DB
712
-        $NOVA_BIN_DIR/nova-manage api_db sync
712
+        $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF api_db sync
713 713
 
714 714
         # Run online migrations on the new databases
715 715
         # Needed for flavor conversion
716
-        $NOVA_BIN_DIR/nova-manage db online_data_migrations
716
+        $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db online_data_migrations
717 717
     fi
718 718
 
719 719
     create_nova_cache_dir