[icinga-checkins] icinga.org: icingaweb2-module-director/master: IcingaConfig: Add v1-masterless config format

git at icinga.org git at icinga.org
Thu Nov 3 14:23:22 CET 2016


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

Author: Markus Frosch <markus.frosch at icinga.com>
Date:   Thu Oct 13 15:51:37 2016 +0200

IcingaConfig: Add v1-masterless config format

Do not render a passive checkable to the master zone then.

refs #12919

---

 application/forms/SettingsForm.php             |    1 +
 library/Director/IcingaConfig/IcingaConfig.php |    2 +-
 library/Director/Objects/IcingaObject.php      |    1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/application/forms/SettingsForm.php b/application/forms/SettingsForm.php
index a8b7486..ab7baf0 100644
--- a/application/forms/SettingsForm.php
+++ b/application/forms/SettingsForm.php
@@ -88,6 +88,7 @@ class SettingsForm extends QuickForm
                 array(
                     'v2' => $this->translate('Icinga v2.x'),
                     'v1' => $this->translate('Icinga v1.x'),
+                    'v1-masterless' => $this->translate('Icinga v1.x (no master)'),
                 )
             ),
             'description'  => $this->translate(
diff --git a/library/Director/IcingaConfig/IcingaConfig.php b/library/Director/IcingaConfig/IcingaConfig.php
index 549aa71..b14c5a7 100644
--- a/library/Director/IcingaConfig/IcingaConfig.php
+++ b/library/Director/IcingaConfig/IcingaConfig.php
@@ -90,7 +90,7 @@ class IcingaConfig
 
     public function isLegacy()
     {
-        return $this->configFormat === 'v1';
+        return strpos($this->configFormat, 'v1') === 0;
     }
 
     public function getObjectCount()
diff --git a/library/Director/Objects/IcingaObject.php b/library/Director/Objects/IcingaObject.php
index af9e412..a0795bc 100644
--- a/library/Director/Objects/IcingaObject.php
+++ b/library/Director/Objects/IcingaObject.php
@@ -1482,6 +1482,7 @@ abstract class IcingaObject extends DbObject implements IcingaConfigRenderer
         if (
             $this->getResolvedProperty('zone_id')
             && array_key_exists('enable_active_checks', $this->defaultProperties)
+            && $config->getConfigFormat() !== 'v1-masterless'
         ) {
             $passive = clone($this);
             $passive->enable_active_checks = false;



More information about the icinga-checkins mailing list