mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-26 15:14:07 +02:00
Implement HOSTADDRESS and HOSTADDRESS6 macros.
This commit is contained in:
parent
bf58700c10
commit
4cd4228f64
@ -610,9 +610,18 @@ bool Host::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *res
|
|||||||
|
|
||||||
Dictionary::Ptr macros = GetMacros();
|
Dictionary::Ptr macros = GetMacros();
|
||||||
|
|
||||||
if (macros && macros->Contains(macro)) {
|
if (macros) {
|
||||||
*result = macros->Get(macro);
|
String name = macro;
|
||||||
return true;
|
|
||||||
|
if (name == "HOSTADDRESS")
|
||||||
|
name = "address";
|
||||||
|
else if (macro == "HOSTADDRESS6")
|
||||||
|
name = "address6";
|
||||||
|
|
||||||
|
if (macros->Contains(name)) {
|
||||||
|
*result = macros->Get(name);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user