Browse code

Add new parameter RECREATE_KEYSTONE_DB

If 'RECREATE_KEYSTONE_DB=False' database won't be recreated.
It would be useful for multinode Grenade tests for Keystone. This parameter
will help us to deploy multiple services on different machines talking to
the same DB.

Devstack recreates Keystone DB each time during Keystone service installation.
If our controller node is already deployed, Keystone DB already contains
important information about OpenStack services and their endpoints. When
the second Keystone node is being deployed, we don't want to delete
records about controllers' services endpoints.

Partially-Implements: bp rolling-upgrade-testing

Change-Id: Ia8d07b4295ca165be01e44466c95d5275f596e83

Julia Varlamova authored on 2016/12/16 19:39:31
Showing 2 changed files
... ...
@@ -488,8 +488,10 @@ function init_keystone {
488 488
         init_ldap
489 489
     fi
490 490
 
491
-    # (Re)create keystone database
492
-    recreate_database keystone
491
+    if [[ "$RECREATE_KEYSTONE_DB" == True ]]; then
492
+        # (Re)create keystone database
493
+        recreate_database keystone
494
+    fi
493 495
 
494 496
     # Initialize keystone database
495 497
     $KEYSTONE_BIN_DIR/keystone-manage --config-file $KEYSTONE_CONF db_sync
... ...
@@ -819,6 +819,10 @@ GIT_DEPTH=${GIT_DEPTH:-0}
819 819
 # Use native SSL for servers in ``SSL_ENABLED_SERVICES``
820 820
 USE_SSL=$(trueorfalse False USE_SSL)
821 821
 
822
+# We may not need to recreate database in case 2 Keystone services
823
+# sharing the same database. It would be useful for multinode Grenade tests.
824
+RECREATE_KEYSTONE_DB=$(trueorfalse True RECREATE_KEYSTONE_DB)
825
+
822 826
 # ebtables is inherently racey. If you run it by two or more processes
823 827
 # simultaneously it will collide, badly, in the kernel and produce
824 828
 # failures or corruption of ebtables. The only way around it is for