Commit fa33205d authored by drumm's avatar drumm Committed by Neil Drumm

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

Conflicts:
	file/file.drush.inc
parents d1274217 f6230cbf
...@@ -4,4 +4,4 @@ projects[] = "drupal" ...@@ -4,4 +4,4 @@ projects[] = "drupal"
projects[hostmaster][type] = "profile" projects[hostmaster][type] = "profile"
projects[hostmaster][download][type] = "git" projects[hostmaster][download][type] = "git"
projects[hostmaster][download][url] = "git://git.aegirproject.org/hostmaster.git" projects[hostmaster][download][url] = "git://git.aegirproject.org/hostmaster.git"
projects[hostmaster][download][branch] = "dev-services" projects[hostmaster][download][branch] = "master"
...@@ -199,13 +199,13 @@ class provisionService_file extends provisionService { ...@@ -199,13 +199,13 @@ class provisionService_file extends provisionService {
$func = ($recursive) ? array($this, '_chgrp_recursive') : 'chgrp'; $func = ($recursive) ? array($this, '_chgrp_recursive') : 'chgrp';
if ($group = provision_posix_groupname($gid)) { if ($group = provision_posix_groupname($gid)) {
if (provision_user_in_group(drush_get_option('script_user'), $gid)) { if (provision_user_in_group($this->script_user, $gid)) {
if (!call_user_func($func, $path, $group)) { if (!call_user_func($func, $path, $group)) {
$this->tokens['@reason'] = dt("chgrp to @group failed on @path", array('@group' => $group, '@path' => $path)); $this->tokens['@reason'] = dt("chgrp to @group failed on @path", array('@group' => $group, '@path' => $path));
} }
} }
else { else {
$this->tokens['@reason'] = dt("@user is not in @group group", array("@user" => drush_get_option('script_user'), "@group" => $group)); $this->tokens['@reason'] = dt("@user is not in @group group", array("@user" => $this->script_user, "@group" => $group));
} }
} }
elseif (!@call_user_func($func, $path, $gid)) { # try to change the group anyways elseif (!@call_user_func($func, $path, $gid)) { # try to change the group anyways
...@@ -362,7 +362,7 @@ class provisionService_file extends provisionService { ...@@ -362,7 +362,7 @@ class provisionService_file extends provisionService {
} }
if ($exists) { if ($exists) {
$this->chown($path, drush_get_option('script_user')) $this->chown($path, $this->script_user)
->succeed($name . ' ownership of @path has been changed to @uid.') ->succeed($name . ' ownership of @path has been changed to @uid.')
->fail($name . ' ownership of @path could not be changed to @uid.', 'DRUSH_PERM_ERROR'); ->fail($name . ' ownership of @path could not be changed to @uid.', 'DRUSH_PERM_ERROR');
......
...@@ -76,11 +76,11 @@ function drush_provision_hostmaster_install($site) { ...@@ -76,11 +76,11 @@ function drush_provision_hostmaster_install($site) {
'platform' => $platform_name, 'platform' => $platform_name,
'db_server' => $server, 'db_server' => $server,
'uri' => $site, 'uri' => $site,
'client_email' => drush_get_option('client_email', 'webmaster@localhost'), 'client_email' => drush_get_option('client_email', 'webmaster@example.com'),
'site_port' => drush_get_option('web_port', 80), 'site_port' => drush_get_option('web_port', 80),
'profile' => 'hostmaster', 'profile' => 'hostmaster',
)); ));
provision_backend_invoke($site_name, 'provision-install'); $data = provision_backend_invoke($site_name, 'provision-install');
provision_backend_invoke($site_name, 'provision-verify'); provision_backend_invoke($site_name, 'provision-verify');
drush_print("Initializing the hosting system"); drush_print("Initializing the hosting system");
......
...@@ -44,6 +44,25 @@ function & d($name = NULL, $root_object = FALSE) { ...@@ -44,6 +44,25 @@ function & d($name = NULL, $root_object = FALSE) {
} }
} }
/**
* Simple access layer for drush_sitealias_get_record.
*
* Everytime sitealiases are fetched a lot of processing happens,
* but if the file doesnt exist yet there's a whole lot of unnecesary
* stuff happening.
*
* We cache the result locally here.
*/
function provision_sitealias_get_record($name) {
static $cache = array();
if (!isset($cache[$name])) {
$cache[$name] = drush_sitealias_get_record($name);
}
return $cache[$name];
}
/** /**
* Create a new environment object and cache it in the d() static cache function. * Create a new environment object and cache it in the d() static cache function.
*/ */
...@@ -52,7 +71,7 @@ function provision_environment_factory($name) { ...@@ -52,7 +71,7 @@ function provision_environment_factory($name) {
$type = 'server'; $type = 'server';
$record = drush_sitealias_get_record($name); $record = provision_sitealias_get_record($name);
$options = array_merge(drush_get_context('stdin'), drush_get_context('options')); $options = array_merge(drush_get_context('stdin'), drush_get_context('options'));
if (isset($record['context_type'])) { if (isset($record['context_type'])) {
...@@ -93,7 +112,7 @@ class provisionEnvironment { ...@@ -93,7 +112,7 @@ class provisionEnvironment {
*/ */
function __get($name) { function __get($name) {
if ($name == 'options') { if ($name == 'options') {
return array_merge(drush_sitealias_get_record($this->name), array_filter(drush_get_context('stdin')), array_filter(drush_get_context('options'))); return array_merge(provision_sitealias_get_record($this->name), array_filter(drush_get_context('stdin')), array_filter(drush_get_context('options')));
} }
if (array_key_exists($name, $this->properties)) { if (array_key_exists($name, $this->properties)) {
if (isset($this->oid_map[$name]) && !empty($this->properties[$name])) { if (isset($this->oid_map[$name]) && !empty($this->properties[$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