mirror of https://github.com/Icinga/icinga2.git
Change behaviour of multiple dependencies (all failed = unreachable)
This commit is contained in:
parent
2f82047737
commit
d0c0beb8be
|
@ -72,15 +72,25 @@ bool Checkable::IsReachable(DependencyType dt, Dependency::Ptr *failedDependency
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const Dependency::Ptr& dep : GetDependencies()) {
|
auto deps = GetDependencies();
|
||||||
|
|
||||||
|
int countFailed = 0;
|
||||||
|
|
||||||
|
for (const Dependency::Ptr& dep : deps) {
|
||||||
if (!dep->IsAvailable(dt)) {
|
if (!dep->IsAvailable(dt)) {
|
||||||
|
countFailed++;
|
||||||
|
|
||||||
if (failedDependency)
|
if (failedDependency)
|
||||||
*failedDependency = dep;
|
*failedDependency = dep;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (countFailed == deps.size()) {
|
||||||
|
Log(LogDebug, "Checkable")
|
||||||
|
<< "All dependencies have failed for checkable '" << GetName() << "': Marking as unreachable.";
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (failedDependency)
|
if (failedDependency)
|
||||||
*failedDependency = nullptr;
|
*failedDependency = nullptr;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue