IcingaEndpoint: deploy to where it's Zone is...

...to be found

refs #463
This commit is contained in:
Thomas Gelf 2017-03-29 11:41:13 +02:00
parent 3714d2567b
commit 58ba7f9f86
1 changed files with 15 additions and 0 deletions

View File

@ -6,6 +6,8 @@ use Icinga\Exception\ProgrammingError;
use Icinga\Module\Director\Core\CoreApi;
use Icinga\Module\Director\Core\LegacyDeploymentApi;
use Icinga\Module\Director\Core\RestApiClient;
use Icinga\Module\Director\Exception\NestingError;
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
class IcingaEndpoint extends IcingaObject
{
@ -82,6 +84,19 @@ class IcingaEndpoint extends IcingaObject
return $client;
}
public function getRenderingZone(IcingaConfig $config = null)
{
try {
if ($zone = $this->getResolvedProperty('zone_id')) {
return $zone->getRenderingZone($config);
}
} catch (NestingError $e) {
return self::RESOLVE_ERROR;
}
return parent::getRenderingZone($config);
}
/**
* Use duration time renderer helper
*