IcingaConfig: allow to toggle legacy renderer

refs #12264
This commit is contained in:
Thomas Gelf 2016-08-01 06:59:31 +00:00
parent 7655ad451a
commit 4c978db3d0
2 changed files with 6 additions and 1 deletions

View File

@ -35,7 +35,7 @@ class IcingaConfig
protected $generationTime;
protected $configFormat = 'v2';
protected $configFormat;
public static $table = 'director_generated_config';
@ -46,6 +46,7 @@ class IcingaConfig
$this->connection = $connection;
$this->db = $connection->getDbAdapter();
$this->configFormat = $this->connection->getSetting('config_format', 'v2');
}
public function getSize()

View File

@ -1151,6 +1151,10 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
public function renderToConfig(IcingaConfig $config)
{
if ($config->isLegacy()) {
return $this->renderToLegacyConfig($config);
}
if ($this->isExternal()) {
return;
}