From: Gunnar Beutner Date: Sat, 17 May 2014 10:58:35 +0000 (+0200) Subject: Set parent_host_name in Dependency objects to the host's name for apply rules. X-Git-Tag: v2.0.0-beta1~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5f5d7b0a205a222e92b5a935b646121ac52f589;p=icinga2 Set parent_host_name in Dependency objects to the host's name for apply rules. Fixes #6197 --- diff --git a/lib/icinga/dependency-apply.cpp b/lib/icinga/dependency-apply.cpp index e91f4b19c..67b69aef8 100644 --- a/lib/icinga/dependency-apply.cpp +++ b/lib/icinga/dependency-apply.cpp @@ -68,6 +68,11 @@ bool Dependency::EvaluateApplyRule(const Checkable::Ptr& checkable, const ApplyR builder->SetName(rule.GetName()); builder->SetScope(rule.GetScope()); + builder->AddExpression(make_shared(&AExpression::OpSet, + make_shared(&AExpression::OpLiteral, "parent_host_name", di), + make_shared(&AExpression::OpLiteral, host->GetName(), di), + di)); + builder->AddExpression(make_shared(&AExpression::OpSet, make_shared(&AExpression::OpLiteral, "child_host_name", di), make_shared(&AExpression::OpLiteral, host->GetName(), di),