JobsCommand: really run also single jobs

This commit is contained in:
Thomas Gelf 2016-06-28 14:35:03 +02:00
parent 4494af559f
commit a078efd032
1 changed files with 6 additions and 4 deletions

View File

@ -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) {