]> granicus.if.org Git - icinga2/commitdiff
Fix how the HOSTALIAS and CONTACTALIAS macros work.
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 2 Jul 2013 07:54:24 +0000 (09:54 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 2 Jul 2013 07:54:24 +0000 (09:54 +0200)
lib/icinga/host.cpp
lib/icinga/user.cpp

index 27f069d0216b8f75a59b65da9d71f036fc4b2363..246fa44aa698079feb18f198bd552a51a1b1d3e3 100644 (file)
@@ -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;
        }
index 53e297670f96992b478c7cae19ec15c54cb6fae6..c4ce9291f42cddfb64700256fdc5eb93e9d5e5a8 100644 (file)
@@ -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();