From: Gunnar Beutner Date: Sat, 5 Apr 2014 21:15:56 +0000 (+0200) Subject: Fix yet another validation issue. X-Git-Tag: v0.0.10~193 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=020eaf99ab3fa4b0c5dab702b8e6a6f800fbe0c4;p=icinga2 Fix yet another validation issue. Refs #5925 --- 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",