Browse code

Merge "lib/nova: create api db first"

Jenkins authored on 2017/01/14 02:17:10
Showing 1 changed files
... ...
@@ -677,6 +677,9 @@ function init_nova {
677 677
     # All nova components talk to a central database.
678 678
     # Only do this step once on the API node for an entire cluster.
679 679
     if is_service_enabled $DATABASE_BACKENDS && is_service_enabled n-api; then
680
+        recreate_database $NOVA_API_DB
681
+        $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF api_db sync
682
+
680 683
         # (Re)create nova databases
681 684
         recreate_database nova
682 685
         recreate_database nova_api_cell0
... ...
@@ -690,9 +693,6 @@ function init_nova {
690 690
             recreate_database $NOVA_CELLS_DB
691 691
         fi
692 692
 
693
-        recreate_database $NOVA_API_DB
694
-        $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF api_db sync
695
-
696 693
         # Run online migrations on the new databases
697 694
         # Needed for flavor conversion
698 695
         $NOVA_BIN_DIR/nova-manage --config-file $NOVA_CONF db online_data_migrations