From: Gunnar Beutner Date: Mon, 11 Nov 2013 15:42:35 +0000 (+0100) Subject: Fix service and notification templates. X-Git-Tag: v0.0.4~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0dba71ecafb083387d8b1b5134333627f0047151;p=icinga2 Fix service and notification templates. Fixes #5058 --- 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();