From: Gunnar Beutner Date: Tue, 2 Jul 2013 07:47:31 +0000 (+0200) Subject: Implement HOSTADDRESS and HOSTADDRESS6 macros. X-Git-Tag: v0.0.2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4cd4228f64cfa15a8f3df1196572bed65a79e156;p=icinga2 Implement HOSTADDRESS and HOSTADDRESS6 macros. --- 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;