mirror of https://github.com/Icinga/icinga2.git
Implement HOSTADDRESS and HOSTADDRESS6 macros.
This commit is contained in:
parent
bf58700c10
commit
4cd4228f64
|
@ -610,10 +610,19 @@ bool Host::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *res
|
|||
|
||||
Dictionary::Ptr macros = GetMacros();
|
||||
|
||||
if (macros && macros->Contains(macro)) {
|
||||
*result = macros->Get(macro);
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue