From 0dba71ecafb083387d8b1b5134333627f0047151 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 11 Nov 2013 16:42:35 +0100 Subject: [PATCH] Fix service and notification templates. Fixes #5058 --- lib/icinga/host.cpp | 4 ---- lib/icinga/icinga-type.conf | 8 ++++++-- lib/icinga/service-notification.cpp | 4 ---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/icinga/host.cpp b/lib/icinga/host.cpp index 8bc79665f..6291eba6d 100644 --- a/lib/icinga/host.cpp +++ b/lib/icinga/host.cpp @@ -197,10 +197,6 @@ void Host::UpdateSlaveServices(void) ExpressionList::Ptr svc_exprl = make_shared(); item->GetLinkedExpressionList()->ExtractPath(path, svc_exprl); - std::vector dpath; - dpath.push_back("templates"); - svc_exprl->ErasePath(dpath); - builder->AddExpressionList(svc_exprl); ConfigItem::Ptr serviceItem = builder->Compile(); diff --git a/lib/icinga/icinga-type.conf b/lib/icinga/icinga-type.conf index fe684a63d..d59cd95d9 100644 --- a/lib/icinga/icinga-type.conf +++ b/lib/icinga/icinga-type.conf @@ -113,7 +113,9 @@ type Service { %attribute any "*" } - } + }, + + %attribute any "templates" } type ServiceGroup { @@ -147,7 +149,9 @@ type Notification { %attribute name(TimePeriod) "notification_period", %attribute number "notification_type_filter", - %attribute number "notification_state_filter" + %attribute number "notification_state_filter", + + %attribute any "templates" } type User { diff --git a/lib/icinga/service-notification.cpp b/lib/icinga/service-notification.cpp index 77158fad1..cb15c06b3 100644 --- a/lib/icinga/service-notification.cpp +++ b/lib/icinga/service-notification.cpp @@ -149,10 +149,6 @@ void Service::UpdateSlaveNotifications(void) ExpressionList::Ptr nfc_exprl = make_shared(); item->GetLinkedExpressionList()->ExtractPath(path, nfc_exprl); - std::vector dpath; - dpath.push_back("templates"); - nfc_exprl->ErasePath(dpath); - builder->AddExpressionList(nfc_exprl); ConfigItem::Ptr notificationItem = builder->Compile(); -- 2.40.0