IcingaHostGroup|IcingaService(Set): Fix legacy config file extension

refs #13049
This commit is contained in:
Markus Frosch 2016-11-14 15:06:31 +01:00
parent fee8e7847d
commit d4c3be0bf5
3 changed files with 9 additions and 4 deletions

View File

@ -88,7 +88,7 @@ class IcingaHostGroup extends IcingaObjectGroup
$zone = $this->connection->getDefaultGlobalZoneName();
}
return $config->configFile(
'director/' . $zone . '/hostgroups'
'director/' . $zone . '/hostgroups', '.cfg'
);
}

View File

@ -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'
);
}

View File

@ -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'
);
}