parent
274c153837
commit
0fcbc2783b
|
@ -6,11 +6,13 @@ use Exception;
|
||||||
use Icinga\Data\Filter\Filter;
|
use Icinga\Data\Filter\Filter;
|
||||||
use Icinga\Module\Director\Db;
|
use Icinga\Module\Director\Db;
|
||||||
use Icinga\Module\Director\Db\Cache\PrefetchCache;
|
use Icinga\Module\Director\Db\Cache\PrefetchCache;
|
||||||
|
use Icinga\Module\Director\Db\DbUtil;
|
||||||
use Icinga\Module\Director\DirectorObject\Automation\ExportInterface;
|
use Icinga\Module\Director\DirectorObject\Automation\ExportInterface;
|
||||||
use Icinga\Module\Director\Exception\DuplicateKeyException;
|
use Icinga\Module\Director\Exception\DuplicateKeyException;
|
||||||
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
|
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
|
||||||
use Icinga\Module\Director\Resolver\HostServiceBlacklist;
|
use Icinga\Module\Director\Resolver\HostServiceBlacklist;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
use Ramsey\Uuid\Uuid;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
|
||||||
class IcingaServiceSet extends IcingaObject implements ExportInterface
|
class IcingaServiceSet extends IcingaObject implements ExportInterface
|
||||||
|
@ -108,20 +110,16 @@ class IcingaServiceSet extends IcingaObject implements ExportInterface
|
||||||
if ($set->get('id') === null) {
|
if ($set->get('id') === null) {
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$connection = $this->getConnection();
|
$connection = $this->getConnection();
|
||||||
$db = $this->getDb();
|
$db = $this->getDb();
|
||||||
$ids = $db->fetchCol(
|
$uuids = $db->fetchCol(
|
||||||
$db->select()->from('icinga_service', 'id')
|
$db->select()->from('icinga_service', 'uuid')
|
||||||
->where('service_set_id = ?', $set->get('id'))
|
->where('service_set_id = ?', $set->get('id'))
|
||||||
);
|
);
|
||||||
|
|
||||||
$services = array();
|
$services = array();
|
||||||
foreach ($ids as $id) {
|
foreach ($uuids as $uuid) {
|
||||||
$service = IcingaService::load(array(
|
$service = IcingaService::loadWithUniqueId(Uuid::fromBytes(DbUtil::binaryResult($uuid)), $connection);
|
||||||
'id' => $id,
|
|
||||||
'object_type' => 'template'
|
|
||||||
), $connection);
|
|
||||||
$service->set('service_set', null);
|
$service->set('service_set', null);
|
||||||
|
|
||||||
$services[$service->getObjectName()] = $service;
|
$services[$service->getObjectName()] = $service;
|
||||||
|
|
Loading…
Reference in New Issue