Db: getDeploymentEndpointName should retrieve...

...only endpoints with a configured api user
This commit is contained in:
Thomas Gelf 2016-02-17 16:42:42 +01:00
parent 3df0115895
commit 19a92b1bef
1 changed files with 9 additions and 5 deletions

View File

@ -38,12 +38,16 @@ class Db extends DbConnection
{
$db = $this->db();
$query = $db->select()->from(
array('e' => 'icinga_endpoint'),
array('z' => 'icinga_zone'),
array('object_name' => 'e.object_name')
)->join(
array('z' => 'icinga_zone'),
array(),
'e.zone_id = z.id'
array('e' => 'icinga_endpoint'),
'e.zone_id = z.id',
array()
)->join(
array('au' => 'icinga_apiuser'),
'e.apiuser_id = au.id',
array()
)->where('z.object_name = ?', $this->getMasterZoneName())
->order('e.object_name ASC')
->limit(1);
@ -51,7 +55,7 @@ class Db extends DbConnection
$name = $db->fetchOne($query);
if (! $name) {
throw new ConfigurationError(
'Unable to detect deployment your endpoint'
'Unable to detect your deployment endpoint'
);
}