From 95093bae3e84dc968429dec53ca2986f6dc40281 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 27 Mar 2017 11:01:14 +0200 Subject: [PATCH] Move log message refs #5094 --- lib/icinga/comment.cpp | 5 +---- lib/icinga/downtime.cpp | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/icinga/comment.cpp b/lib/icinga/comment.cpp index 90944b913..138a9863b 100644 --- a/lib/icinga/comment.cpp +++ b/lib/icinga/comment.cpp @@ -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)) { diff --git a/lib/icinga/downtime.cpp b/lib/icinga/downtime.cpp index b9cf1028b..909ba7e8f 100644 --- a/lib/icinga/downtime.cpp +++ b/lib/icinga/downtime.cpp @@ -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)) {