From 020eaf99ab3fa4b0c5dab702b8e6a6f800fbe0c4 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 5 Apr 2014 23:15:56 +0200 Subject: [PATCH] Fix yet another validation issue. Refs #5925 --- lib/config/configitem.cpp | 5 +++-- lib/icinga/icinga-type.conf | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp index c1263a15f..e86d3c096 100644 --- a/lib/config/configitem.cpp +++ b/lib/config/configitem.cpp @@ -117,10 +117,8 @@ Dictionary::Ptr ConfigItem::GetProperties(void) if (!m_Properties) { m_Properties = make_shared(); m_Properties->Set("type", m_Type); - m_Properties->Set("name", m_Name); m_Properties->Set("__parent", m_Scope); GetExpressionList()->Evaluate(m_Properties); - m_Properties->Remove("name"); m_Properties->Remove("__parent"); String name = m_Name; @@ -136,6 +134,9 @@ Dictionary::Ptr ConfigItem::GetProperties(void) } } + if (name != m_Name) + m_Properties->Set("name", m_Name); + m_Properties->Set("__name", name); VERIFY(m_Properties->Get("type") == GetType()); diff --git a/lib/icinga/icinga-type.conf b/lib/icinga/icinga-type.conf index 511e8714d..b1c1850b8 100644 --- a/lib/icinga/icinga-type.conf +++ b/lib/icinga/icinga-type.conf @@ -85,6 +85,8 @@ %attribute %name(Host) "host_name", %attribute %string "service_name", + %attribute %string "name", + %attribute %array "users" { %attribute %name(User) "*" }, @@ -191,6 +193,8 @@ %attribute %name(Host) "host_name", %attribute %string "service_name", + %attribute %string "name", + %require "author", %attribute %string "author", @@ -215,6 +219,8 @@ %attribute %name(Host) "child_host_name", %attribute %string "child_service_name", + %attribute %string "name", + %attribute %name(TimePeriod) "period", %attribute %number "state_filter", -- 2.40.0