Fix macros.

Refs #5855
This commit is contained in:
Gunnar Beutner 2014-04-05 09:19:42 +02:00
parent c42a582307
commit 5ccdf017ac
4 changed files with 21 additions and 20 deletions

View File

@ -369,14 +369,14 @@ bool Host::ResolveMacro(const String& macro, const CheckResult::Ptr&, String *re
return true; return true;
} }
} }
}
Dictionary::Ptr vars = GetVars(); Dictionary::Ptr vars = GetVars();
if (vars && vars->Contains(key)) { if (vars && vars->Contains(macro)) {
*result = vars->Get(key); *result = vars->Get(macro);
return true; return true;
} }
}
return false; return false;
} }

View File

@ -156,13 +156,14 @@ bool IcingaApplication::ResolveMacro(const String& macro, const CheckResult::Ptr
return true; return true;
} }
}
Dictionary::Ptr vars = GetVars(); Dictionary::Ptr vars = GetVars();
if (vars && vars->Contains(key)) { if (vars && vars->Contains(macro)) {
*result = vars->Get(key); *result = vars->Get(macro);
return true; return true;
} }
}
return false; return false;
} }

View File

@ -199,14 +199,14 @@ bool Service::ResolveMacro(const String& macro, const CheckResult::Ptr& cr, Stri
return true; return true;
} }
} }
}
Dictionary::Ptr vars = GetVars(); Dictionary::Ptr vars = GetVars();
if (vars && vars->Contains(key)) { if (vars && vars->Contains(macro)) {
*result = vars->Get(key); *result = vars->Get(macro);
return true; return true;
} }
}
return false; return false;
} }

View File

@ -79,14 +79,14 @@ bool User::ResolveMacro(const String& macro, const CheckResult::Ptr&, String *re
*result = GetDisplayName(); *result = GetDisplayName();
return true; return true;
} }
}
Dictionary::Ptr vars = GetVars(); Dictionary::Ptr vars = GetVars();
if (vars && vars->Contains(key)) { if (vars && vars->Contains(macro)) {
*result = vars->Get(key); *result = vars->Get(macro);
return true; return true;
} }
}
return false; return false;
} }