[icinga-checkins] icinga.org: icinga2/master: Don' t try to delete Downtime objects that were statically configured

git at icinga.org git at icinga.org
Tue Nov 22 15:14:22 CET 2016


Module: icinga2
Branch: master
Commit: 56e9a23a6570557f2b96469015525d3c9ff197ea
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=56e9a23a6570557f2b96469015525d3c9ff197ea

Author: Gunnar Beutner <gunnar.beutner at icinga.com>
Date:   Tue Nov 22 15:13:43 2016 +0100

Don't try to delete Downtime objects that were statically configured

fixes #13275

---

 lib/icinga/downtime.cpp |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/icinga/downtime.cpp b/lib/icinga/downtime.cpp
index 84cc5b9..796d247 100644
--- a/lib/icinga/downtime.cpp
+++ b/lib/icinga/downtime.cpp
@@ -310,6 +310,9 @@ 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)) {



More information about the icinga-checkins mailing list