Commit 6a8aff70 authored by Adrian Rossouw's avatar Adrian Rossouw

Got site import sort of working, and no longer spawn a verify task because it's already happening.

parent 5ace388b
......@@ -53,6 +53,7 @@ function hosting_platform_post_hosting_verify_task($task, $data) {
$site->title = $url;
$site->platform = $node->nid;
$site->client = HOSTING_DEFAULT_CLIENT;
$site->db_server = HOSTING_DEFAULT_DB_SERVER;
node_save($site);
drush_log(dt("Imported existing site !domain", array('!domain' => _hosting_node_link($site->nid))));
}
......
......@@ -131,6 +131,12 @@ function hosting_site_post_hosting_backup_task($task, $data) {
function hosting_site_post_hosting_import_task($task, $data) {
hosting_import_site($task->ref->nid, $data['context'], $task->ref->platform);
$context = $data['context'];
$packages = $context['packages'];
hosting_package_sync($packages);
hosting_package_instance_sync($task->ref->nid, $packages);
}
function hosting_site_post_hosting_verify_task($task, $data) {
......
......@@ -162,6 +162,8 @@ function hosting_import_site($site_id, $data, $platform = HOSTING_DEFAULT_PLATFO
$site->status = 1;
$site->site_status = 1;
$site->platform = $platform;
$site->no_verify = TRUE;
$site->verified = mktime();
$site->client = $client->nid;
$db_server = hosting_get_db_server($data['db_id']);
$site->db_server = ($db_server) ? $db_server->nid : HOSTING_DEFAULT_DB_SERVER;
......
......@@ -64,7 +64,7 @@ function drush_hosting_task() {
ksort($task->args);
// On install/verify, save the named context
if ($task->task_type === 'install' || $task->task_type === 'verify') {
if ($task->task_type === 'install' || $task->task_type === 'verify' || $task->task_type === 'import') {
module_invoke('hosting_' . $task->ref->type, 'context_options', $task);
$output = drush_backend_invoke_args('provision-save', array('@' . $task->ref->hosting_name), $task->context_options, $mode);
}
......
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