monitoring/commands: Fix the delete comment and delete downtime commands

They included the involved object's name which is wrong.

refs #6593
This commit is contained in:
Eric Lippmann 2014-09-23 17:40:13 -07:00
parent 9601942116
commit 70500be5f7
1 changed files with 4 additions and 28 deletions

View File

@ -322,22 +322,10 @@ class IcingaCommandFileCommandRenderer implements IcingaCommandRendererInterface
public function renderDeleteComment(DeleteCommentCommand $command)
{
$object = $command->getObject();
if ($command->getObject()->getType() === $command::TYPE_HOST) {
/** @var \Icinga\Module\Monitoring\Object\Host $object */
$commandString = sprintf(
'%s;%s',
'DEL_HOST_DOWNTIME',
$object->getName()
);
$commandString = 'DEL_HOST_COMMENT';
} else {
/** @var \Icinga\Module\Monitoring\Object\Service $object */
$commandString = sprintf(
'%s;%s;%s',
'DEL_SVC_COMMENT',
$object->getHost()->getName(),
$object->getName()
);
$commandString = 'DEL_SVC_COMMENT';
}
return sprintf(
'%s;%u',
@ -348,22 +336,10 @@ class IcingaCommandFileCommandRenderer implements IcingaCommandRendererInterface
public function renderDeleteDowntime(DeleteDowntimeCommand $command)
{
$object = $command->getObject();
if ($command->getObject()->getType() === $command::TYPE_HOST) {
/** @var \Icinga\Module\Monitoring\Object\Host $object */
$commandString = sprintf(
'%s;%s',
'DEL_HOST_DOWNTIME',
$object->getName()
);
$commandString = 'DEL_HOST_DOWNTIME';
} else {
/** @var \Icinga\Module\Monitoring\Object\Service $object */
$commandString = sprintf(
'%s;%s;%s',
'DEL_SVC_DOWNTIME',
$object->getHost()->getName(),
$object->getName()
);
$commandString = 'DEL_SVC_DOWNTIME';
}
return sprintf(
'%s;%u',