Set parent_host_name in Dependency objects to the host's name for apply rules.

Fixes #6197
This commit is contained in:
Gunnar Beutner 2014-05-17 12:58:35 +02:00
parent 4e35c39df0
commit d5f5d7b0a2
1 changed files with 5 additions and 0 deletions

View File

@ -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>(&AExpression::OpSet,
make_shared<AExpression>(&AExpression::OpLiteral, "parent_host_name", di),
make_shared<AExpression>(&AExpression::OpLiteral, host->GetName(), di),
di));
builder->AddExpression(make_shared<AExpression>(&AExpression::OpSet,
make_shared<AExpression>(&AExpression::OpLiteral, "child_host_name", di),
make_shared<AExpression>(&AExpression::OpLiteral, host->GetName(), di),