[icinga-checkins] icinga.org: icingaweb2-module-director/master: Settings: remove all legacy getSettings calls

git at icinga.org git at icinga.org
Tue Aug 30 10:48:34 CEST 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Tue Aug 30 07:52:48 2016 +0000

Settings: remove all legacy getSettings calls

---

 application/clicommands/JobsCommand.php        |    2 +-
 library/Director/IcingaConfig/IcingaConfig.php |    7 ++-----
 library/Director/Settings.php                  |    1 +
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/application/clicommands/JobsCommand.php b/application/clicommands/JobsCommand.php
index 39f7150..df8f04c 100644
--- a/application/clicommands/JobsCommand.php
+++ b/application/clicommands/JobsCommand.php
@@ -79,6 +79,6 @@ class JobsCommand extends Command
 
     protected function hasBeenDisabled()
     {
-        return $this->db()->getSetting('disable_all_jobs') === 'y';
+        return $this->db()->settings()->disable_all_jobs === 'y';
     }
 }
diff --git a/library/Director/IcingaConfig/IcingaConfig.php b/library/Director/IcingaConfig/IcingaConfig.php
index 4c810fe..cdc332f 100644
--- a/library/Director/IcingaConfig/IcingaConfig.php
+++ b/library/Director/IcingaConfig/IcingaConfig.php
@@ -46,7 +46,7 @@ class IcingaConfig
 
         $this->connection = $connection;
         $this->db = $connection->getDbAdapter();
-        $this->configFormat = $this->connection->getSetting('config_format', 'v2');
+        $this->configFormat = $this->connection->settings()->config_format;
     }
 
     public function getSize()
@@ -497,10 +497,7 @@ apply Service for (title => params in host.vars["%s"]) {
 
     protected function getMagicApplyVarName()
     {
-        return $this->connection->getSetting(
-            'magic_apply_for',
-            '_director_apply_for'
-        );
+        return $this->connection->settings()->magic_apply_for;
     }
 
     protected function usesMagicApplyFor()
diff --git a/library/Director/Settings.php b/library/Director/Settings.php
index bb2f244..69fb7d8 100644
--- a/library/Director/Settings.php
+++ b/library/Director/Settings.php
@@ -16,6 +16,7 @@ class Settings
         'config_format'                  => 'v2',
         'override_services_varname'      => '_override_servicevars',
         'override_services_templatename' => 'host var overrides (Director)',
+        // 'disable_all_jobs'            => null, // 'y'
         // 'experimental_features'       => null, // 'allow'
         // 'master_zone'                 => null,
     );



More information about the icinga-checkins mailing list