Db: getDeploymentEndpointName should retrieve...
...only endpoints with a configured api user
This commit is contained in:
parent
3df0115895
commit
19a92b1bef
|
@ -38,12 +38,16 @@ class Db extends DbConnection
|
||||||
{
|
{
|
||||||
$db = $this->db();
|
$db = $this->db();
|
||||||
$query = $db->select()->from(
|
$query = $db->select()->from(
|
||||||
array('e' => 'icinga_endpoint'),
|
array('z' => 'icinga_zone'),
|
||||||
array('object_name' => 'e.object_name')
|
array('object_name' => 'e.object_name')
|
||||||
)->join(
|
)->join(
|
||||||
array('z' => 'icinga_zone'),
|
array('e' => 'icinga_endpoint'),
|
||||||
array(),
|
'e.zone_id = z.id',
|
||||||
'e.zone_id = z.id'
|
array()
|
||||||
|
)->join(
|
||||||
|
array('au' => 'icinga_apiuser'),
|
||||||
|
'e.apiuser_id = au.id',
|
||||||
|
array()
|
||||||
)->where('z.object_name = ?', $this->getMasterZoneName())
|
)->where('z.object_name = ?', $this->getMasterZoneName())
|
||||||
->order('e.object_name ASC')
|
->order('e.object_name ASC')
|
||||||
->limit(1);
|
->limit(1);
|
||||||
|
@ -51,7 +55,7 @@ class Db extends DbConnection
|
||||||
$name = $db->fetchOne($query);
|
$name = $db->fetchOne($query);
|
||||||
if (! $name) {
|
if (! $name) {
|
||||||
throw new ConfigurationError(
|
throw new ConfigurationError(
|
||||||
'Unable to detect deployment your endpoint'
|
'Unable to detect your deployment endpoint'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue