mirror of
https://github.com/Icinga/icinga2.git
synced 2026-04-23 15:17:03 -04:00
parent
a73c1580ca
commit
95093bae3e
2 changed files with 2 additions and 8 deletions
|
|
@ -208,15 +208,12 @@ void Comment::RemoveComment(const String& id, const MessageOrigin::Ptr& origin)
|
|||
{
|
||||
Comment::Ptr comment = Comment::GetByName(id);
|
||||
|
||||
if (!comment)
|
||||
if (!comment || comment->GetPackage() != "_api")
|
||||
return;
|
||||
|
||||
Log(LogNotice, "Comment")
|
||||
<< "Removed comment '" << comment->GetName() << "' from object '" << comment->GetCheckable()->GetName() << "'.";
|
||||
|
||||
if (comment->GetPackage() != "_api")
|
||||
return;
|
||||
|
||||
Array::Ptr errors = new Array();
|
||||
|
||||
if (!ConfigObjectUtility::DeleteObject(comment, false, errors)) {
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ void Downtime::RemoveDowntime(const String& id, bool cancelled, bool expired, co
|
|||
{
|
||||
Downtime::Ptr downtime = Downtime::GetByName(id);
|
||||
|
||||
if (!downtime)
|
||||
if (!downtime || downtime->GetPackage() != "_api")
|
||||
return;
|
||||
|
||||
String config_owner = downtime->GetConfigOwner();
|
||||
|
|
@ -310,9 +310,6 @@ void Downtime::RemoveDowntime(const String& id, bool cancelled, bool expired, co
|
|||
Log(LogNotice, "Downtime")
|
||||
<< "Removed downtime '" << downtime->GetName() << "' from object '" << downtime->GetCheckable()->GetName() << "'.";
|
||||
|
||||
if (downtime->GetPackage() != "_api")
|
||||
return;
|
||||
|
||||
Array::Ptr errors = new Array();
|
||||
|
||||
if (!ConfigObjectUtility::DeleteObject(downtime, false, errors)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue