]> granicus.if.org Git - icinga2/blobdiff - lib/icinga/servicegroup.cpp
Move the VMFrame class to libbase
[icinga2] / lib / icinga / servicegroup.cpp
index a3c007b61915f98bfeafa9a1a34a6b1df272a621..e205c7dd5dd1e76e3c03b7a4e7272532a65875c3 100644 (file)
@@ -46,12 +46,13 @@ bool ServiceGroup::EvaluateObjectRule(const Service::Ptr& service, const ConfigI
 
        Host::Ptr host = service->GetHost();
 
-       Dictionary::Ptr locals = new Dictionary();
-       locals->Set("__parent", group->GetScope());
-       locals->Set("host", host);
-       locals->Set("service", service);
+       ScriptFrame frame;
+       if (group->GetScope())
+               group->GetScope()->CopyTo(frame.Locals);
+       frame.Locals->Set("host", host);
+       frame.Locals->Set("service", service);
 
-       if (!group->GetFilter()->Evaluate(locals))
+       if (!group->GetFilter()->Evaluate(frame))
                return false;
 
        Log(LogDebug, "ServiceGroup")