From 58ba7f9f864f56db06a5f71c57c2b682b0a37c4a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 29 Mar 2017 11:41:13 +0200 Subject: [PATCH] IcingaEndpoint: deploy to where it's Zone is... ...to be found refs #463 --- library/Director/Objects/IcingaEndpoint.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/library/Director/Objects/IcingaEndpoint.php b/library/Director/Objects/IcingaEndpoint.php index 55203008..d84994f4 100644 --- a/library/Director/Objects/IcingaEndpoint.php +++ b/library/Director/Objects/IcingaEndpoint.php @@ -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 *