From d4c3be0bf5d032baf8819cffb9596988350284d1 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Mon, 14 Nov 2016 15:06:31 +0100 Subject: [PATCH] IcingaHostGroup|IcingaService(Set): Fix legacy config file extension refs #13049 --- library/Director/Objects/IcingaHostGroup.php | 2 +- library/Director/Objects/IcingaService.php | 4 +++- library/Director/Objects/IcingaServiceSet.php | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/library/Director/Objects/IcingaHostGroup.php b/library/Director/Objects/IcingaHostGroup.php index 5c7959c6..9a42a4dc 100644 --- a/library/Director/Objects/IcingaHostGroup.php +++ b/library/Director/Objects/IcingaHostGroup.php @@ -88,7 +88,7 @@ class IcingaHostGroup extends IcingaObjectGroup $zone = $this->connection->getDefaultGlobalZoneName(); } return $config->configFile( - 'director/' . $zone . '/hostgroups' + 'director/' . $zone . '/hostgroups', '.cfg' ); } diff --git a/library/Director/Objects/IcingaService.php b/library/Director/Objects/IcingaService.php index 2981620f..49bc2e68 100644 --- a/library/Director/Objects/IcingaService.php +++ b/library/Director/Objects/IcingaService.php @@ -210,8 +210,10 @@ class IcingaService extends IcingaObject protected function legacyHostnameServicesFile($hostname, IcingaConfig $config) { + $host = IcingaHost::load($hostname, $this->getConnection()); return $config->configFile( - 'director/' . IcingaHost::load($hostname, $this->getConnection())->getRenderingZone($config) . '/service_apply' + 'director/' . $host->getRenderingZone($config) . '/service_apply', + '.cfg' ); } diff --git a/library/Director/Objects/IcingaServiceSet.php b/library/Director/Objects/IcingaServiceSet.php index 12c6f39a..4251a260 100644 --- a/library/Director/Objects/IcingaServiceSet.php +++ b/library/Director/Objects/IcingaServiceSet.php @@ -225,15 +225,18 @@ class IcingaServiceSet extends IcingaObject protected function legacyHostnameServicesFile($hostname, IcingaConfig $config) { + $host = IcingaHost::load($hostname, $this->getConnection()); return $config->configFile( - 'director/' . IcingaHost::load($hostname, $this->getConnection())->getRenderingZone($config) . '/servicesets' + 'director/' . $host->getRenderingZone($config) . '/servicesets', + '.cfg' ); } protected function legacyRelatedHostFile(IcingaService $service, IcingaConfig $config) { return $config->configFile( - 'director/' . $service->getRelated('host')->getRenderingZone($config) . '/servicesets' + 'director/' . $service->getRelated('host')->getRenderingZone($config) . '/servicesets', + '.cfg' ); }