[icinga-checkins] icinga.org: icingaweb2-module-director/fiddle/mfrosch: ConfigJob: replace housekeeping-related code

git at icinga.org git at icinga.org
Thu May 19 16:46:14 CEST 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Tue May 17 16:05:00 2016 +0200

ConfigJob: replace housekeeping-related code

---

 library/Director/Job/ConfigJob.php |   36 +++++++++++++++++++++---------------
 1 file changed, 21 insertions(+), 15 deletions(-)

diff --git a/library/Director/Job/ConfigJob.php b/library/Director/Job/ConfigJob.php
index da80a98..585f75e 100644
--- a/library/Director/Job/ConfigJob.php
+++ b/library/Director/Job/ConfigJob.php
@@ -10,35 +10,41 @@ use Icinga\Module\Director\Util;
 
 class ConfigJob extends JobHook
 {
-    protected $housekeeping;
-
     public function run()
     {
-        $this->housekeeping()->runAllTasks();
     }
 
+    public static function addSettingsFormFields(QuickForm $form)
+    {
+        $form->addElement('select', 'deploy_when_changed', array(
+            'label'        => $form->translate('Deploy modified config'),
+            'description'  => $form->translate(
+                'This allows you to immediately deploy a modified configuration'
+            ),
+            'value'        => 'n',
+            'multiOptions' => array(
+                'y'  => $form->translate('Yes'),
+                'n'  => $form->translate('No'),
+            )
+        ));
+
+        return $form;
+    }
+
+
     public function isPending()
     {
-        return $this->housekeeping()->hasPendingTasks();
+        return false;
     }
 
     public static function getDescription(QuickForm $form)
     {
         return $form->translate(
-            'The Housekeeping job provides various task that keep your Director'
-            . ' database fast and clean'
+            'The Config job allows you to generate and eventually deploy your'
+            . 'Icinga 2 configuration'
         );
     }
 
-    protected function housekeeping()
-    {
-        if ($this->housekeeping === null) {
-            $this->housekeeping = new Housekeeping($this->db());
-        }
-
-        return $this->housekeeping;
-    }
-
     /**
      * Re-render the current configuration
      */



More information about the icinga-checkins mailing list