From 46b149dd7d3409902c367a19774d6a2f9ec168bb Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 2 Nov 2014 07:35:43 +0100 Subject: [PATCH] Implement support for formatting arrays in macro strings fixes #7262 --- lib/icinga/macroprocessor.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/icinga/macroprocessor.cpp b/lib/icinga/macroprocessor.cpp index a0e63c9da..74108f9ea 100644 --- a/lib/icinga/macroprocessor.cpp +++ b/lib/icinga/macroprocessor.cpp @@ -89,7 +89,12 @@ bool MacroProcessor::ResolveMacro(const String& macro, const ResolverList& resol Dictionary::Ptr vars = dobj->GetVars(); if (vars && vars->Contains(macro)) { - *result = vars->Get(macro); + Value value = vars->Get(macro); + + if (value.IsObjectType()) + value = Utility::Join(value, ';'); + + *result = value; *recursive_macro = true; return true; } @@ -142,6 +147,9 @@ bool MacroProcessor::ResolveMacro(const String& macro, const ResolverList& resol tokens[0] == "notes") *recursive_macro = true; + if (ref.IsObjectType()) + ref = Utility::Join(ref, ';'); + *result = ref; return true; }