1
0
mirror of https://github.com/Icinga/icinga2.git synced 2025-04-08 17:05:25 +02:00

Fix missing target types in ScheduledDowntime apply.

Fixes 
This commit is contained in:
Michael Friedrich 2014-04-07 13:06:28 +02:00
parent e97e1cf63f
commit 0e3b387a70

@ -93,14 +93,25 @@ void ScheduledDowntime::EvaluateApplyRule(const Checkable::Ptr& checkable, const
void ScheduledDowntime::EvaluateApplyRules(const std::vector<ApplyRule>& rules)
{
BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjects<Host>()) {
CONTEXT("Evaluating 'apply' rules for host '" + host->GetName() + "'");
BOOST_FOREACH(const ApplyRule& rule, rules) {
if (rule.GetTargetType() != "Host")
continue;
EvaluateApplyRule(host, rule);
}
}
BOOST_FOREACH(const Service::Ptr& service, DynamicType::GetObjects<Service>()) {
CONTEXT("Evaluating 'apply' rules for Service '" + service->GetName() + "'");
Dictionary::Ptr locals = make_shared<Dictionary>();
locals->Set("host", service->GetHost());
locals->Set("service", service);
BOOST_FOREACH(const ApplyRule& rule, rules) {
if (rule.GetTargetType() != "Service")
continue;
EvaluateApplyRule(service, rule);
}
}
}