Skip to content

Commit

Permalink
Fix inconsistency in sandesh c++/python client code in
Browse files Browse the repository at this point in the history
collector service subscription with discovery

c++ sandesh client:
- subscribes for collector service irrespective of whether the collector
list is provided in the InitGenerator(), if CollectorSubFn is not NULL.

python sandesh client:
- subscribes for collector service only if the collector list is empty
in init_generator()

Modified the sandesh c++ library to subscribe for the collector service
only if the collector list is empty.

Change-Id: I57a2c8f2612df0b8b8f4ebef72d2dd7f62d8f626
Closes-Bug: #1531524
  • Loading branch information
Sundaresan Rajangam committed Jan 27, 2016
1 parent 16f4690 commit 9689b0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion library/cpp/sandesh_client.cc
Expand Up @@ -102,7 +102,9 @@ void SandeshClient::Initiate() {
sm_->SetAdminState(false);
if (primary_ != Endpoint())
sm_->SetCandidates(primary_,secondary_);
if (csf_!=0){
// subscribe for the collector service only if the collector list
// is not provided by the generator.
else if (csf_ != 0) {
SANDESH_LOG(INFO, "Subscribe to Discovery Service for Collector" );
csf_(g_vns_constants.COLLECTOR_DISCOVERY_SERVICE_NAME, 2,
boost::bind(&SandeshClient::CollectorHandler, this, _1));
Expand Down

0 comments on commit 9689b0b

Please sign in to comment.