Bugfix: Delegation didn't work for local-only instances.

This commit is contained in:
Gunnar Beutner 2012-10-12 15:45:33 +02:00
parent a0e608ce97
commit b740628042
1 changed files with 5 additions and 7 deletions

View File

@ -44,13 +44,14 @@ vector<Endpoint::Ptr> DelegationComponent::GetCheckerCandidates(const Service::P
BOOST_FOREACH(tie(tuples::ignore, object), DynamicObject::GetObjects("Endpoint")) {
Endpoint::Ptr endpoint = dynamic_pointer_cast<Endpoint>(object);
/* ignore local-only endpoints */
if (endpoint->IsLocal())
String myIdentity = EndpointManager::GetInstance()->GetIdentity();
/* ignore local-only endpoints (unless this is a local-only instance) */
if (endpoint->IsLocal() && !myIdentity.IsEmpty())
continue;
/* ignore disconnected endpoints */
if (!endpoint->IsConnected() &&
endpoint->GetName() != EndpointManager::GetInstance()->GetIdentity())
if (!endpoint->IsConnected() && endpoint->GetName() != myIdentity)
continue;
/* ignore endpoints that aren't running the checker component */
@ -75,9 +76,6 @@ void DelegationComponent::DelegationTimerHandler(void)
BOOST_FOREACH(tie(tuples::ignore, object), DynamicObject::GetObjects("Endpoint")) {
Endpoint::Ptr endpoint = dynamic_pointer_cast<Endpoint>(object);
if (endpoint->IsLocal())
continue;
histogram[endpoint] = 0;
}