[icinga-checkins] icinga.org: icinga2/master: Make the 'name' attribute available in object definitions

git at icinga.org git at icinga.org
Sat Nov 1 06:39:50 CET 2014


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

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Sat Nov  1 06:39:21 2014 +0100

Make the 'name' attribute available in object definitions

fixes #7538

---

 lib/config/configitem.cpp |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp
index 5d51fd5..1ccec6c 100644
--- a/lib/config/configitem.cpp
+++ b/lib/config/configitem.cpp
@@ -126,12 +126,16 @@ Dictionary::Ptr ConfigItem::GetProperties(void)
 	ObjectLock olock(this);
 
 	if (!m_Properties) {
+		Dictionary::Ptr locals = make_shared<Dictionary>();
+		locals->Set("__parent", m_Scope);
+		locals->Set("name", m_Name);
+
 		DebugHint dhint;
 		m_Properties = make_shared<Dictionary>();
 		m_Properties->Set("type", m_Type);
 		if (!m_Zone.IsEmpty())
 			m_Properties->Set("zone", m_Zone);
-		m_Properties->Set("__parent", m_Scope);
+		m_Properties->Set("__parent", locals);
 		GetExpressionList()->Evaluate(m_Properties, &dhint);
 		m_Properties->Remove("__parent");
 		m_DebugHints = dhint.ToDictionary();



More information about the icinga-checkins mailing list