0a71316726
As advised in I072cf8bf6748d0c910fecffdf2282bcc4656d038, code should use 4 spaces for indentation. This commit enforces the use of 4 spaces indentation. In order to simplify the review process, this patch only cover the following elements: - os-apply-config - os-collect-config - os-refresh-config - os-svc-install - pacemaker - pypi-mirror - qpidd - rabbitmq-server - snmpd - stackuser - tripleo-cd Change-Id: I3f365f6a1cd6fd9e56402ad3bd6572192b85d798
19 lines
393 B
Bash
Executable File
19 lines
393 B
Bash
Executable File
#!/bin/bash
|
|
set -eu
|
|
|
|
function create_db() {
|
|
local sql="
|
|
create database if not exists $1;
|
|
grant all on $1.* to '$2'@'localhost' identified by '$3';
|
|
grant all on $1.* to '$2'@'%' identified by '$3';
|
|
flush privileges;"
|
|
echo "$sql" | mysql
|
|
}
|
|
|
|
if [ $# -lt 3 ]; then
|
|
echo "Usage: os-db-create DB_NAME DB_USER DB_PASS"
|
|
exit 1
|
|
fi
|
|
|
|
create_db $*
|