Commit 6395ff2d authored by drumm's avatar drumm Committed by Neil Drumm

Merge branch 'master' of ssh://gitosis@git.aegirproject.org/hostmaster

Conflicts:
	modules/hosting/server/hosting_server.service.inc
parents 22641d78 2327abd7
......@@ -67,17 +67,15 @@ function hostmaster_bootstrap() {
$node->services = array();
hosting_services_add($node, 'server', 'base', array(
'script_user' => drush_get_option('script_user'),
'drush_path' => DRUSH_COMMAND,
'config_path' => drush_get_option('config_path'),
'backup_path' => drush_get_option('backup_path'),
'script_user' => d()->platform->server->script_user,
'config_path' => d()->platform->server->config_path,
'available' => 1,
));
hosting_services_add($node, 'http', 'apache', array(
'web_group' => drush_get_option('web_group'),
'restart_cmd' => drush_get_option('restart_cmd', _provision_default_restart_cmd()),
'ports' => drush_get_option('web_ports'),
'web_group' => d()->platform->server->web_group,
'restart_cmd' => d()->platform->server->restart_cmd,
'ports' => d()->platform->server->web_ports,
'available' => 1,
));
......@@ -85,8 +83,8 @@ function hostmaster_bootstrap() {
variable_set('hosting_default_web_server', $node->nid);
variable_set('hosting_own_web_server', $node->nid);
$master_db = parse_url(drush_get_option('master_db'));
if (!in_array($master_db['host'], array('localhost', '127.0.0.1', $_SERVER['HTTP_HOST']))) {
$master_db = parse_url(d()->platform->server->master_db);
if (!in_array($master_db['host'], array('localhost', '127.0.0.1'))) {
$node = new stdClass();
$node->uid = 1;
$node->type = 'server';
......@@ -120,7 +118,7 @@ function hostmaster_bootstrap() {
$node->uid = 1;
$node->type = 'platform';
$node->title = 'hostmaster';
$node->publish_path = drush_locate_root(drush_get_option(array('r', 'root'), NULL));
$node->publish_path = d()->root;
$node->web_server = variable_get('hosting_default_web_server', 3);
$node->status = 1;
node_save($node);
......@@ -143,7 +141,6 @@ function hostmaster_bootstrap() {
// This is saved because the config generation script is running via drush, and does not have access to this value
variable_set('install_url' , $GLOBALS['base_url']);
}
......
......@@ -30,16 +30,6 @@ function hosting_server_schema() {
'size' => 'big',
'not null' => FALSE,
),
'backup_path' => array(
'type' => 'text',
'size' => 'big',
'not null' => FALSE,
),
'drush_path' => array(
'type' => 'text',
'size' => 'big',
'not null' => FALSE,
),
),
'primary key' => array('vid'),
);
......@@ -99,3 +89,16 @@ function hosting_server_update_6000() {
return $return;
}
/**
* Drop the drush_path and backup_path columns which are no longer needed.
*/
function hosting_server_update_6001() {
$ret = array();
db_drop_field($ret, "hosting_server", "drush_path");
db_drop_field($ret, "hosting_server", "backup_path");
return $ret;
}
......@@ -72,17 +72,6 @@ class hostingService_server_base extends hostingService {
public $type = 'base';
function form(&$form) {
$form['drush_path'] = array(
'#type' => 'textfield',
'#title' => t('Drush path'),
'#required' => $this->available,
'#size' => 40,
'#default_value' => ($this->drush_path) ? $this->drush_path : HOSTING_DEFAULT_PARENT_PATH.'/drush/drush.php',
'#description' => t("The full path to the drush.php script on this server."),
'#maxlength' => 255,
'#weight' => -8,
);
$form['script_user'] = array(
'#type' => 'textfield',
'#title' => t('System account'),
......@@ -106,19 +95,6 @@ class hostingService_server_base extends hostingService {
'#weight' => -4,
);
$form['backup_path'] = array(
'#type' => 'textfield',
'#title' => t('Backup path'),
'#required' => $this->available,
'#size' => 40,
'#default_value' => ($this->backup_path) ? $this->backup_path : HOSTING_DEFAULT_BACKUP_PATH,
'#description' => t("The path on the server where backups will be stored.<br />
It is essential that this directory should not be accessible via a web browser."),
'#maxlength' => 255,
'#weight' => -3,
);
}
......@@ -131,9 +107,15 @@ class hostingService_server_base extends hostingService {
function insert() {
parent::insert();
<<<<<<< HEAD:modules/hosting/server/hosting_server.service.inc
db_query("INSERT INTO {hosting_server} (vid, nid, script_user, config_path, backup_path, drush_path)
VALUES (%d, %d, '%s', '%s', '%s', '%s', '%s')",
$this->server->vid, $this->server->nid, $this->script_user, $this->config_path, $this->backup_path, $this->drush_path);
=======
db_query("INSERT INTO {hosting_server} (vid, nid, ip_address, script_user, config_path)
VALUES (%d, %d, '%s', '%s', '%s')",
$this->server->vid, $this->server->nid, $this->ip_address, $this->script_user, $this->config_path);
>>>>>>> e558432322c318404aff55790d1c540b17b7b201:modules/hosting/server/hosting_server.service.inc
}
function delete_revision() {
......@@ -148,6 +130,7 @@ class hostingService_server_base extends hostingService {
function load() {
parent::load();
<<<<<<< HEAD:modules/hosting/server/hosting_server.service.inc
$this->mergeData('SELECT script_user, config_path, backup_path, drush_path FROM {hosting_server} WHERE vid = %d', $this->server->vid);
}
......@@ -157,6 +140,19 @@ class hostingService_server_base extends hostingService {
'#title' => t('Drush path'),
'#value' => filter_xss($this->drush_path),
);
=======
$this->mergeData('SELECT ip_address, script_user, config_path FROM {hosting_server} WHERE vid = %d', $this->server->vid);
}
function view(&$render) {
if ($this->ip_address) {
$render['ip_address'] = array(
'#type' => 'item',
'#title' => t('IP address'),
'#value' => filter_xss($this->ip_address),
);
}
>>>>>>> e558432322c318404aff55790d1c540b17b7b201:modules/hosting/server/hosting_server.service.inc
$render['script_user'] = array(
'#type' => 'item',
......@@ -169,11 +165,6 @@ class hostingService_server_base extends hostingService {
'#title' => t('Configuration path'),
'#value' => filter_xss($this->config_path),
);
$render['backup_path'] = array(
'#type' => 'item',
'#title' => t('Backup path'),
'#value' => filter_xss($this->backup_path),
);
}
/**
......@@ -184,7 +175,6 @@ class hostingService_server_base extends hostingService {
$task->context_options['remote_host'] = $this->server->title;
$task->context_options['script_user'] = $this->script_user;
$task->context_options['config_path'] = $this->config_path;
$task->context_options['backup_path'] = $this->backup_path;
if (!drush_is_local_host($task->context_options['remote_host'])) {
$task->context_options['file_service_type'] = 'remote';
}
......
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