Commit 30caeafc authored by drumm's avatar drumm Committed by Neil Drumm

Grant privileges to the remote web server when using one.

parent 458b757e
......@@ -108,20 +108,22 @@ class provisionService_db extends provisionService {
$creds = $this->generate_site_credentials();
extract($creds);
if (!$this->can_create_database()) {
drush_set_error('PROVISION_CREATE_DB_FAILED');
drush_log("Database could not be created.", 'error');
return FALSE;
drush_set_error('PROVISION_CREATE_DB_FAILED');
drush_log("Database could not be created.", 'error');
return FALSE;
}
drush_log(dt("Granting privileges to %user@%client on %database", array('%user' => $db_user, '%client' => $db_grant_host, '%database' => $db_name)));
if (!$this->grant($db_name, $db_user, $db_passwd, $db_grant_host)) {
drush_set_error('PROVISION_CREATE_DB_FAILED', dt("Could not create database user @user", array('@user' => $db_user)));
}
if ($this->remote_host !== $db_grant_host) {
drush_log(dt("Granting privileges to %user@%client on %database", array('%user' => $db_user, '%client' => $this->remote_host, '%database' => $db_name)));
if (!$this->grant($db_name, $db_user, $db_passwd, $this->remote_host)) {
drush_set_error('PROVISION_CREATE_DB_FAILED', dt("Could not create database user @user", array('@user' => $db_user)));
}
}
$this->create_database($db_name);
$status = $this->database_exists($db_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment