Merge pull request #2914 from Icinga/fix/api-command-ack-wo-expire

API Commands: Only send acknowledgement expire time if not null
This commit is contained in:
lippserd 2017-08-09 13:29:10 +02:00 committed by GitHub
commit 16f9fa35c9
1 changed files with 3 additions and 1 deletions

View File

@ -179,10 +179,12 @@ class IcingaApiCommandRenderer implements IcingaCommandRendererInterface
$data = array(
'author' => $command->getAuthor(),
'comment' => $command->getComment(),
'expiry' => $command->getExpireTime(),
'sticky' => $command->getSticky(),
'notify' => $command->getNotify()
);
if ($command->getExpireTime() !== null) {
$data['expiry'] = $command->getExpireTime();
}
$this->applyFilter($data, $command->getObject());
return IcingaApiCommand::create($endpoint, $data);
}