Skip to content

Commit

Permalink
monitoring/commands: Fix the delete comment and delete downtime commands
Browse files Browse the repository at this point in the history
They included the involved object's name which is wrong.

refs #6593
  • Loading branch information
lippserd committed Sep 24, 2014
1 parent 9601942 commit 70500be
Showing 1 changed file with 4 additions and 28 deletions.
Expand Up @@ -322,22 +322,10 @@ public function renderToggleObjectFeature(ToggleObjectFeatureCommand $command)

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',
Expand All @@ -348,22 +336,10 @@ public function renderDeleteComment(DeleteCommentCommand $command)

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',
Expand Down

0 comments on commit 70500be

Please sign in to comment.