From: Gunnar Beutner Date: Tue, 2 Jul 2013 07:54:24 +0000 (+0200) Subject: Fix how the HOSTALIAS and CONTACTALIAS macros work. X-Git-Tag: v0.0.2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=184f503c2a0e48dc8b9448681a7e226f6e522424;p=icinga2 Fix how the HOSTALIAS and CONTACTALIAS macros work. --- diff --git a/lib/icinga/host.cpp b/lib/icinga/host.cpp index 27f069d02..246fa44aa 100644 --- a/lib/icinga/host.cpp +++ b/lib/icinga/host.cpp @@ -541,11 +541,11 @@ String Host::StateToString(HostState state) bool Host::ResolveMacro(const String& macro, const Dictionary::Ptr&, String *result) const { - if (macro == "HOSTNAME" || macro == "HOSTALIAS") { + if (macro == "HOSTNAME") { *result = GetName(); return true; } - else if (macro == "HOSTDISPLAYNAME") { + else if (macro == "HOSTDISPLAYNAME" || macro == "HOSTALIAS") { *result = GetDisplayName(); return true; } diff --git a/lib/icinga/user.cpp b/lib/icinga/user.cpp index 53e297670..c4ce9291f 100644 --- a/lib/icinga/user.cpp +++ b/lib/icinga/user.cpp @@ -103,7 +103,7 @@ bool User::ResolveMacro(const String& macro, const Dictionary::Ptr& cr, String * *result = GetName(); return true; } else if (macro == "CONTACTALIAS") { - *result = GetName(); + *result = GetDisplayName(); return true; } else { Dictionary::Ptr macros = GetMacros();