diff --git a/library/Director/IcingaConfig/IcingaConfig.php b/library/Director/IcingaConfig/IcingaConfig.php index 87651eed..4c810fe6 100644 --- a/library/Director/IcingaConfig/IcingaConfig.php +++ b/library/Director/IcingaConfig/IcingaConfig.php @@ -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() diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php index b47b43a6..9034b95c 100644 --- a/library/Director/Objects/IcingaObject.php +++ b/library/Director/Objects/IcingaObject.php @@ -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; }