Browse code

Try to set initial mysql root password also on Ubuntu

On Ubuntu nodes, devstack tries to predefine the initial mysql root
password by doing some debconf-set-selections, but these will not take
effect if the corresponding package has been installed earlier. So
just try to set it every time, like we do on other distros.

Change-Id: I2c167051fc5e53dd0ccf82a60ab085cd9cdea28d

Jens Rosenboom authored on 2016/12/08 05:12:55
Showing 1 changed files
... ...
@@ -82,10 +82,9 @@ function configure_database_mysql {
82 82
     fi
83 83
 
84 84
     # Set the root password - only works the first time. For Ubuntu, we already
85
-    # did that with debconf before installing the package.
86
-    if ! is_ubuntu; then
87
-        sudo mysqladmin -u root password $DATABASE_PASSWORD || true
88
-    fi
85
+    # did that with debconf before installing the package, but we still try,
86
+    # because the package might have been installed already.
87
+    sudo mysqladmin -u root password $DATABASE_PASSWORD || true
89 88
 
90 89
     # Update the DB to give user '$DATABASE_USER'@'%' full control of the all databases:
91 90
     sudo mysql -uroot -p$DATABASE_PASSWORD -h127.0.0.1 -e "GRANT ALL PRIVILEGES ON *.* TO '$DATABASE_USER'@'%' identified by '$DATABASE_PASSWORD';"