mirror of https://github.com/Icinga/icinga2.git
Merge pull request #7538 from Icinga/bugfix/dependency-ignore_on_error-7536
Dependency#OnAllConfigLoaded(): don't link *this with the child if *this is going to be dropped
This commit is contained in:
commit
f0fcfdf910
|
@ -75,8 +75,6 @@ void Dependency::OnAllConfigLoaded()
|
||||||
if (!m_Child)
|
if (!m_Child)
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Dependency '" + GetName() + "' references a child host/service which doesn't exist.", GetDebugInfo()));
|
BOOST_THROW_EXCEPTION(ScriptError("Dependency '" + GetName() + "' references a child host/service which doesn't exist.", GetDebugInfo()));
|
||||||
|
|
||||||
m_Child->AddDependency(this);
|
|
||||||
|
|
||||||
Host::Ptr parentHost = Host::GetByName(GetParentHostName());
|
Host::Ptr parentHost = Host::GetByName(GetParentHostName());
|
||||||
|
|
||||||
if (parentHost) {
|
if (parentHost) {
|
||||||
|
@ -89,6 +87,7 @@ void Dependency::OnAllConfigLoaded()
|
||||||
if (!m_Parent)
|
if (!m_Parent)
|
||||||
BOOST_THROW_EXCEPTION(ScriptError("Dependency '" + GetName() + "' references a parent host/service which doesn't exist.", GetDebugInfo()));
|
BOOST_THROW_EXCEPTION(ScriptError("Dependency '" + GetName() + "' references a parent host/service which doesn't exist.", GetDebugInfo()));
|
||||||
|
|
||||||
|
m_Child->AddDependency(this);
|
||||||
m_Parent->AddReverseDependency(this);
|
m_Parent->AddReverseDependency(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue