Commit 4b818613 authored by Jon Pugh's avatar Jon Pugh

Remove drush_provision_drupal_pre_provision_install_rollback() and replace...

Remove drush_provision_drupal_pre_provision_install_rollback() and replace with drush_provision_drupal_pre_provision_verify_rollback().

drush_provision_drupal_pre_provision_verify_rollback() must check for a bootstrapped site, or a single verify fail would destroy the site's config.
parent dc2e70b9
......@@ -35,11 +35,14 @@ function drush_provision_drupal_pre_provision_install() {
* If the install went south, and the site is not PROVISION_SITE_INSTALLED, clean up behind ourselves
*/
function drush_provision_drupal_pre_provision_install_rollback() {
_provision_recursive_delete( d()->site_path );
drush_invoke_process('@none', 'provision-save', array(d()->name), array('delete' => TRUE));
foreach (d()->drush_aliases as $alias) {
drush_invoke_process('@none', 'provision-save', array($alias), array('delete' => TRUE));
}
// @TODO: Remove this code. We must not run the deletion of these on install rollback
// because it is now the "Verify" task that creates these files.
// _provision_recursive_delete( d()->site_path );
// drush_invoke_process('@none', 'provision-save', array(d()->name), array('delete' => TRUE));
// foreach (d()->drush_aliases as $alias) {
// drush_invoke_process('@none', 'provision-save', array($alias), array('delete' => TRUE));
// }
}
......
......@@ -203,6 +203,22 @@ function drush_provision_drupal_provision_verify() {
}
/**
* If the install went south, and the site is not PROVISION_SITE_INSTALLED, clean up behind ourselves
*/
//function drush_provision_drupal_pre_provision_install_rollback() {
function drush_provision_drupal_pre_provision_verify_rollback() {
// If we cannot fully bootstrap drupal, destroy the files we created.
if (drush_bootstrap_max() != DRUSH_BOOTSTRAP_DRUPAL_LOGIN) {
_provision_recursive_delete(d()->site_path);
drush_invoke_process('@none', 'provision-save', array(d()->name), array('delete' => TRUE));
foreach (d()->drush_aliases as $alias) {
drush_invoke_process('@none', 'provision-save', array($alias), array('delete' => TRUE));
}
}
}
/**
* Implements drush_hook_provision_post_COMMAND().
*/
......
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