Browse code

Merge "Remove the usage of read_password from library files"

Zuul authored on 2019/07/15 21:15:42
Showing 3 changed files
... ...
@@ -87,8 +87,6 @@ function initialize_database_backends {
87 87
 
88 88
     if [ -n "$MYSQL_PASSWORD" ]; then
89 89
         DATABASE_PASSWORD=$MYSQL_PASSWORD
90
-    else
91
-        read_password DATABASE_PASSWORD "ENTER A PASSWORD TO USE FOR THE DATABASE."
92 90
     fi
93 91
 
94 92
     # We configure Nova, Horizon, Glance and Keystone to use MySQL as their
... ...
@@ -56,7 +56,6 @@ function configure_nova_hypervisor {
56 56
         die $LINENO "os-xenapi plugin is not specified. Please enable this plugin in local.conf"
57 57
     fi
58 58
 
59
-    read_password XENAPI_PASSWORD "ENTER A PASSWORD TO USE FOR XEN."
60 59
     iniset $NOVA_CONF DEFAULT compute_driver "xenapi.XenAPIDriver"
61 60
     iniset $NOVA_CONF xenserver connection_url "$XENAPI_CONNECTION_URL"
62 61
     iniset $NOVA_CONF xenserver connection_username "$XENAPI_USER"
... ...
@@ -701,7 +701,14 @@ function read_password {
701 701
 # The available database backends are listed in ``DATABASE_BACKENDS`` after
702 702
 # ``lib/database`` is sourced. ``mysql`` is the default.
703 703
 
704
-initialize_database_backends && echo "Using $DATABASE_TYPE database backend" || echo "No database enabled"
704
+if initialize_database_backends; then
705
+    echo "Using $DATABASE_TYPE database backend"
706
+    # Last chance for the database password. This must be handled here
707
+    # because read_password is not a library function.
708
+    read_password DATABASE_PASSWORD "ENTER A PASSWORD TO USE FOR THE DATABASE."
709
+else
710
+    echo "No database enabled"
711
+fi
705 712
 
706 713
 
707 714
 # Queue Configuration
... ...
@@ -739,6 +746,16 @@ if is_service_enabled keystone; then
739 739
 fi
740 740
 
741 741
 
742
+# Nova
743
+# -----
744
+
745
+if is_service_enabled nova && [[ "$VIRT_DRIVER" == 'xenserver' ]]; then
746
+    # Look for the backend password here because read_password
747
+    # is not a library function.
748
+    read_password XENAPI_PASSWORD "ENTER A PASSWORD TO USE FOR XEN."
749
+fi
750
+
751
+
742 752
 # Swift
743 753
 # -----
744 754