Fix incorrect variable values for apply+for

fixes #8851
This commit is contained in:
Gunnar Beutner 2015-03-23 15:52:09 +01:00
parent 3d7c2c2270
commit d3c0c1e42b
4 changed files with 4 additions and 4 deletions

View File

@ -54,7 +54,7 @@ bool Dependency::EvaluateApplyRuleInstance(const Checkable::Ptr& checkable, cons
ConfigItemBuilder::Ptr builder = new ConfigItemBuilder(di);
builder->SetType("Dependency");
builder->SetName(name);
builder->SetScope(frame.Locals);
builder->SetScope(frame.Locals->ShallowClone());
Host::Ptr host;
Service::Ptr service;

View File

@ -54,7 +54,7 @@ bool Notification::EvaluateApplyRuleInstance(const Checkable::Ptr& checkable, co
ConfigItemBuilder::Ptr builder = new ConfigItemBuilder(di);
builder->SetType("Notification");
builder->SetName(name);
builder->SetScope(frame.Locals);
builder->SetScope(frame.Locals->ShallowClone());
Host::Ptr host;
Service::Ptr service;

View File

@ -53,7 +53,7 @@ bool ScheduledDowntime::EvaluateApplyRuleInstance(const Checkable::Ptr& checkabl
ConfigItemBuilder::Ptr builder = new ConfigItemBuilder(di);
builder->SetType("ScheduledDowntime");
builder->SetName(name);
builder->SetScope(frame.Locals);
builder->SetScope(frame.Locals->ShallowClone());
Host::Ptr host;
Service::Ptr service;

View File

@ -52,7 +52,7 @@ bool Service::EvaluateApplyRuleInstance(const Host::Ptr& host, const String& nam
ConfigItemBuilder::Ptr builder = new ConfigItemBuilder(di);
builder->SetType("Service");
builder->SetName(name);
builder->SetScope(frame.Locals);
builder->SetScope(frame.Locals->ShallowClone());
builder->AddExpression(new SetExpression(MakeIndexer(ScopeCurrent, "host_name"), OpSetLiteral, MakeLiteral(host->GetName()), di));