CLUSTER_READY=$(mysql -u root --exec="SHOW STATUS LIKE 'wsrep_cluster_status'" | grep Primary)
TIMEOUT=${DB_MAX_TIMEOUT:-60}
while[[-z"${CLUSTER_READY}"]];do
if[[${TIMEOUT}-gt 0 ]];then
let TIMEOUT-=1
sleep 1
else
exit 1
fi
done
# NOTE(sbezverk): Currently kolla-kubernetes does not use Galera and disables wsrep driver.
# This check will run only for non kolla-kubernetes bootstrap deployments.
if[[!"${!KOLLA_KUBERNETES[@]}"]];then
CLUSTER_READY=$(mysql -u root --exec="SHOW STATUS LIKE 'wsrep_cluster_status'" | grep Primary)
TIMEOUT=${DB_MAX_TIMEOUT:-60}
while[[-z"${CLUSTER_READY}"]];do
if[[${TIMEOUT}-gt 0 ]];then
let TIMEOUT-=1
sleep 1
else
exit 1
fi
done
fi
sudo-E kolla_security_reset
mysql -u root --password="${DB_ROOT_PASSWORD}"-e"GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '${DB_ROOT_PASSWORD}' WITH GRANT OPTION;"
mysql -u root --password="${DB_ROOT_PASSWORD}"-e"GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '${DB_ROOT_PASSWORD}' WITH GRANT OPTION;"