mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-02 03:14:29 +02:00
Use object name if HOSTADDRESS macro isn't defined.
This commit is contained in:
parent
4637bc1ca6
commit
acc2bdb875
@ -610,7 +610,6 @@ bool Host::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *res
|
|||||||
|
|
||||||
Dictionary::Ptr macros = GetMacros();
|
Dictionary::Ptr macros = GetMacros();
|
||||||
|
|
||||||
if (macros) {
|
|
||||||
String name = macro;
|
String name = macro;
|
||||||
|
|
||||||
if (name == "HOSTADDRESS")
|
if (name == "HOSTADDRESS")
|
||||||
@ -618,10 +617,14 @@ bool Host::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *res
|
|||||||
else if (macro == "HOSTADDRESS6")
|
else if (macro == "HOSTADDRESS6")
|
||||||
name = "address6";
|
name = "address6";
|
||||||
|
|
||||||
if (macros->Contains(name)) {
|
if (macros && macros->Contains(name)) {
|
||||||
*result = macros->Get(name);
|
*result = macros->Get(name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (macro == "HOSTADDRESS" || macro == "HOSTADDRESS6") {
|
||||||
|
*result = GetName();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user