[icinga-checkins] icinga.org: icinga2/master: DB IDO: Log a deprecation warning for categories

git at icinga.org git at icinga.org
Thu Jul 7 15:45:49 CEST 2016


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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Thu Jul  7 15:44:31 2016 +0200

DB IDO: Log a deprecation warning for categories

refs #12024

---

 lib/db_ido/dbconnection.cpp |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/db_ido/dbconnection.cpp b/lib/db_ido/dbconnection.cpp
index 495ffde..1e54bfc 100644
--- a/lib/db_ido/dbconnection.cpp
+++ b/lib/db_ido/dbconnection.cpp
@@ -49,9 +49,11 @@ void DbConnection::OnConfigLoaded(void)
 	Value categories = GetCategories();
 
 	//TODO: Remove 'cat1 | cat2' notation in 2.6
-	if (categories.IsNumber())
+	if (categories.IsNumber()) {
 		SetCategoryFilter(categories);
-	else
+		Log(LogWarning, "DbConnection")
+		    << "Specifying flags using '|' for 'categories' is deprecated. This functionality will be removed in 2.6.0. Please use an array.";
+	} else
 		SetCategoryFilter(FilterArrayToInt(categories, DbQuery::GetCategoryFilterMap(), DbCatEverything));
 
 	if (!GetEnableHa()) {



More information about the icinga-checkins mailing list