]> granicus.if.org Git - icinga2/commitdiff
Dependency#OnAllConfigLoaded(): don't link *this with the child if *this is going... 7538/head
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Wed, 25 Sep 2019 09:30:50 +0000 (11:30 +0200)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Wed, 25 Sep 2019 09:30:50 +0000 (11:30 +0200)
refs #7536

lib/icinga/dependency.cpp

index d2261cfe136ae398e78a5929d757837d4a36a0d5..bfb91d226e3d726b1a5629d1d8bc1209f3942380 100644 (file)
@@ -75,8 +75,6 @@ void Dependency::OnAllConfigLoaded()
        if (!m_Child)
                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());
 
        if (parentHost) {
@@ -89,6 +87,7 @@ void Dependency::OnAllConfigLoaded()
        if (!m_Parent)
                BOOST_THROW_EXCEPTION(ScriptError("Dependency '" + GetName() + "' references a parent host/service which doesn't exist.", GetDebugInfo()));
 
+       m_Child->AddDependency(this);
        m_Parent->AddReverseDependency(this);
 }