From 7a3957cb0b85c056e389fd2a9774f697971c14a7 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Mon, 23 Mar 2015 15:52:09 +0100 Subject: [PATCH] Fix incorrect variable values for apply+for fixes #8851 --- lib/icinga/dependency-apply.cpp | 2 +- lib/icinga/notification-apply.cpp | 2 +- lib/icinga/scheduleddowntime-apply.cpp | 2 +- lib/icinga/service-apply.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/icinga/dependency-apply.cpp b/lib/icinga/dependency-apply.cpp index be761bd1b..14d2b84bf 100644 --- a/lib/icinga/dependency-apply.cpp +++ b/lib/icinga/dependency-apply.cpp @@ -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; diff --git a/lib/icinga/notification-apply.cpp b/lib/icinga/notification-apply.cpp index d52ec8500..fd8e5a3b3 100644 --- a/lib/icinga/notification-apply.cpp +++ b/lib/icinga/notification-apply.cpp @@ -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; diff --git a/lib/icinga/scheduleddowntime-apply.cpp b/lib/icinga/scheduleddowntime-apply.cpp index 32f86c449..af5812304 100644 --- a/lib/icinga/scheduleddowntime-apply.cpp +++ b/lib/icinga/scheduleddowntime-apply.cpp @@ -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; diff --git a/lib/icinga/service-apply.cpp b/lib/icinga/service-apply.cpp index 065dd5f93..6af43204b 100644 --- a/lib/icinga/service-apply.cpp +++ b/lib/icinga/service-apply.cpp @@ -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)); -- 2.40.0