"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "lib/icinga/dependency.cpp" between
icinga2-2.11.5.tar.gz and icinga2-2.12.0.tar.gz

About: Icinga 2 is an enterprise grade monitoring system which keeps watch over networks and any conceivable network resource.

dependency.cpp  (icinga2-2.11.5):dependency.cpp  (icinga2-2.12.0)
skipping to change at line 78 skipping to change at line 78
if (childHost) { if (childHost) {
if (GetChildServiceName().IsEmpty()) if (GetChildServiceName().IsEmpty())
m_Child = childHost; m_Child = childHost;
else else
m_Child = childHost->GetServiceByShortName(GetChildServic eName()); m_Child = childHost->GetServiceByShortName(GetChildServic eName());
} }
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) {
if (GetParentServiceName().IsEmpty()) if (GetParentServiceName().IsEmpty())
m_Parent = parentHost; m_Parent = parentHost;
else else
m_Parent = parentHost->GetServiceByShortName(GetParentSer viceName()); m_Parent = parentHost->GetServiceByShortName(GetParentSer viceName());
} }
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);
} }
void Dependency::Stop(bool runtimeRemoved) void Dependency::Stop(bool runtimeRemoved)
{ {
ObjectImpl<Dependency>::Stop(runtimeRemoved); ObjectImpl<Dependency>::Stop(runtimeRemoved);
GetChild()->RemoveDependency(this); GetChild()->RemoveDependency(this);
GetParent()->RemoveReverseDependency(this); GetParent()->RemoveReverseDependency(this);
} }
skipping to change at line 204 skipping to change at line 203
ObjectImpl<Dependency>::ValidateStates(lvalue, utils); ObjectImpl<Dependency>::ValidateStates(lvalue, utils);
int sfilter = FilterArrayToInt(lvalue(), Notification::GetStateFilterMap( ), 0); int sfilter = FilterArrayToInt(lvalue(), Notification::GetStateFilterMap( ), 0);
if (GetParentServiceName().IsEmpty() && (sfilter & ~(StateFilterUp | Stat eFilterDown)) != 0) if (GetParentServiceName().IsEmpty() && (sfilter & ~(StateFilterUp | Stat eFilterDown)) != 0)
BOOST_THROW_EXCEPTION(ValidationError(this, { "states" }, "State filter is invalid for host dependency.")); BOOST_THROW_EXCEPTION(ValidationError(this, { "states" }, "State filter is invalid for host dependency."));
if (!GetParentServiceName().IsEmpty() && (sfilter & ~(StateFilterOK | Sta teFilterWarning | StateFilterCritical | StateFilterUnknown)) != 0) if (!GetParentServiceName().IsEmpty() && (sfilter & ~(StateFilterOK | Sta teFilterWarning | StateFilterCritical | StateFilterUnknown)) != 0)
BOOST_THROW_EXCEPTION(ValidationError(this, { "states" }, "State filter is invalid for service dependency.")); BOOST_THROW_EXCEPTION(ValidationError(this, { "states" }, "State filter is invalid for service dependency."));
} }
void Dependency::SetParent(intrusive_ptr<Checkable> parent)
{
m_Parent = parent;
}
void Dependency::SetChild(intrusive_ptr<Checkable> child)
{
m_Child = child;
}
 End of changes. 3 change blocks. 
2 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)