[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaHost: agent-related hint for legacy config

git at icinga.org git at icinga.org
Mon Oct 10 12:00:29 CEST 2016


Module: icingaweb2-module-director
Branch: master
Commit: 38eaf4036b51d9f96010866021e7a661edad91d8
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=38eaf4036b51d9f96010866021e7a661edad91d8

Author: Thomas Gelf <thomas at gelf.net>
Date:   Sun Oct  9 13:27:38 2016 +0000

IcingaHost: agent-related hint for legacy config

---

 library/Director/Objects/IcingaHost.php |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/library/Director/Objects/IcingaHost.php b/library/Director/Objects/IcingaHost.php
index e8cd776..65837de 100644
--- a/library/Director/Objects/IcingaHost.php
+++ b/library/Director/Objects/IcingaHost.php
@@ -159,7 +159,12 @@ class IcingaHost extends IcingaObject
     public function renderToConfig(IcingaConfig $config)
     {
         parent::renderToConfig($config);
-        $this->renderAgentZoneAndEndpoint($config);
+
+        // TODO: We might alternatively let the whole config fail in case we have
+        //       used use_agent together with a legacy config
+        if (! $config->isLegacy()) {
+            $this->renderAgentZoneAndEndpoint($config);
+        }
     }
 
     public function renderAgentZoneAndEndpoint(IcingaConfig $config = null)



More information about the icinga-checkins mailing list