Commit 121044e6 authored by Jon Pugh's avatar Jon Pugh

Fixing loading of services by service type.

parent 5f540724
......@@ -165,7 +165,7 @@ class Application extends BaseApplication
$class = '\Aegir\Provision\Context\\' . ucfirst($context_type) . "Context";
$contexts[$context_name] = new $class($context_name, $this->config->all(), $this);
}
if ($name) {
return $contexts[$name];
}
......@@ -220,11 +220,11 @@ class Application extends BaseApplication
public function getServerOptions($service_type = '') {
$servers = [];
foreach ($this->getAllServers() as $server) {
if ($service_type && isset($server->services[$service_type])) {
$servers[$server->name] = $server->name . ': ' . $server->getService($service_type)->type;
if ($service_type && !empty($server->config['services'][$service_type])) {
$servers[$server->name] = $server->name . ': ' . $server->config['services'][$service_type]['type'];
}
else {
$servers[$server->name] = $server->name . ': ' . $server->getService($service_type)->type;
elseif ($service_type == '') {
$servers[$server->name] = $server->name . ': ' . $server->config['services'][$service_type]['type'];
}
}
return $servers;
......
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