From 4cd4228f64cfa15a8f3df1196572bed65a79e156 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 2 Jul 2013 09:47:31 +0200 Subject: [PATCH] Implement HOSTADDRESS and HOSTADDRESS6 macros. --- lib/icinga/host.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/icinga/host.cpp b/lib/icinga/host.cpp index 0d6381682..27f069d02 100644 --- a/lib/icinga/host.cpp +++ b/lib/icinga/host.cpp @@ -610,9 +610,18 @@ bool Host::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *res Dictionary::Ptr macros = GetMacros(); - if (macros && macros->Contains(macro)) { - *result = macros->Get(macro); - return true; + if (macros) { + String name = macro; + + if (name == "HOSTADDRESS") + name = "address"; + else if (macro == "HOSTADDRESS6") + name = "address6"; + + if (macros->Contains(name)) { + *result = macros->Get(name); + return true; + } } return false; -- 2.40.0