[icinga-checkins] icinga.org: icinga2/master: Fix 'use' keyword for templates

git at icinga.org git at icinga.org
Fri Aug 12 13:32:27 CEST 2016


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

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Fri Aug 12 13:32:13 2016 +0200

Fix 'use' keyword for templates

fixes #12409

---

 lib/config/expression.cpp |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/config/expression.cpp b/lib/config/expression.cpp
index 7c18071..14f52ac 100644
--- a/lib/config/expression.cpp
+++ b/lib/config/expression.cpp
@@ -751,6 +751,11 @@ ExpressionResult ImportExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhi
 	if (!item)
 		BOOST_THROW_EXCEPTION(ScriptError("Import references unknown template: '" + name + "'", m_DebugInfo));
 
+	Dictionary::Ptr scope = item->GetScope();
+
+	if (scope)
+		scope->CopyTo(frame.Locals);
+
 	ExpressionResult result = item->GetExpression()->Evaluate(frame, dhint);
 	CHECK_RESULT(result);
 



More information about the icinga-checkins mailing list