From a078efd0327462379eae4330ec70fe949d2b280a Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 28 Jun 2016 14:35:03 +0200 Subject: [PATCH] JobsCommand: really run also single jobs --- application/clicommands/JobsCommand.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/application/clicommands/JobsCommand.php b/application/clicommands/JobsCommand.php index 40e8bcf5..567e6883 100644 --- a/application/clicommands/JobsCommand.php +++ b/application/clicommands/JobsCommand.php @@ -4,6 +4,7 @@ namespace Icinga\Module\Director\Clicommands; use Icinga\Module\Director\Cli\Command; use Icinga\Module\Director\Job\JobRunner; +use Icinga\Module\Director\Objects\DirectorJob; use Icinga\Module\Director\Objects\ImportSource; use Icinga\Module\Director\Objects\SyncRule; use Icinga\Module\Director\IcingaConfig\IcingaConfig; @@ -18,10 +19,11 @@ class JobsCommand extends Command public function runAction() { $forever = $this->params->shift('forever'); - $job = $this->params->shift(); - if ($job) { - echo "Running (theoretically) $job\n"; - return; + $jobId = $this->params->shift(); + if ($jobId) { + $job = DirectorJob::load($jobId, $this->db()); + $job->run(); + exit(0); } if ($forever) {