mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
parent
a73c1580ca
commit
95093bae3e
@ -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…
x
Reference in New Issue
Block a user