Fix cluster check w/ immediate parent and child zone endpoints

fixes #9262
This commit is contained in:
Michael Friedrich 2015-07-31 16:19:58 +02:00
parent 4e4adf4126
commit d7e8d8afc9
1 changed files with 18 additions and 7 deletions

View File

@ -841,7 +841,17 @@ std::pair<Dictionary::Ptr, Dictionary::Ptr> ApiListener::GetStatus(void)
Array::Ptr not_connected_endpoints = new Array();
Array::Ptr connected_endpoints = new Array();
BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
Zone::Ptr my_zone = Zone::GetLocalZone();
BOOST_FOREACH(const Zone::Ptr& zone, DynamicType::GetObjectsByType<Zone>()) {
/* only check endpoints in a) the same zone b) our parent zone c) immediate child zones */
if (my_zone != zone && my_zone != zone->GetParent() && zone != my_zone->GetParent()) {
Log(LogDebug, "ApiListener")
<< "Not checking connection to Zone '" << zone->GetName() << "' because it's not in the same zone, a parent or a child zone.";
continue;
}
BOOST_FOREACH(const Endpoint::Ptr& endpoint, zone->GetEndpoints()) {
if (endpoint->GetName() == GetIdentity())
continue;
@ -852,6 +862,7 @@ std::pair<Dictionary::Ptr, Dictionary::Ptr> ApiListener::GetStatus(void)
else
connected_endpoints->Add(endpoint->GetName());
}
}
status->Set("num_endpoints", count_endpoints);
status->Set("num_conn_endpoints", connected_endpoints->GetLength());