Implicitly convert filter values to bool for object rules

fixes #8184
This commit is contained in:
Gunnar Beutner 2015-01-12 08:38:14 +01:00
parent 2280e20995
commit 9a6a84d9d9
3 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@ bool HostGroup::EvaluateObjectRule(const Host::Ptr& host, const ConfigItem::Ptr&
group->GetScope()->CopyTo(frame.Locals);
frame.Locals->Set("host", host);
if (!group->GetFilter()->Evaluate(frame))
if (!group->GetFilter()->Evaluate(frame).ToBool())
return false;
Log(LogDebug, "HostGroup")

View File

@ -52,7 +52,7 @@ bool ServiceGroup::EvaluateObjectRule(const Service::Ptr& service, const ConfigI
frame.Locals->Set("host", host);
frame.Locals->Set("service", service);
if (!group->GetFilter()->Evaluate(frame))
if (!group->GetFilter()->Evaluate(frame).ToBool())
return false;
Log(LogDebug, "ServiceGroup")

View File

@ -49,7 +49,7 @@ bool UserGroup::EvaluateObjectRule(const User::Ptr& user, const ConfigItem::Ptr&
group->GetScope()->CopyTo(frame.Locals);
frame.Locals->Set("user", user);
if (!group->GetFilter()->Evaluate(frame))
if (!group->GetFilter()->Evaluate(frame).ToBool())
return false;
Log(LogDebug, "UserGroup")