Skip to content

Commit 235424b

Browse files
committed
A few final cleanups for ReplicaSetConnection PYTHON-196
1 parent 1dd141a commit 235424b

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

pymongo/replica_set_connection.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,15 @@ def __check_auth(self, sock, authset):
348348

349349
@property
350350
def seeds(self):
351-
"""Seed list used to connect to this replica set.
351+
"""The seed list used to connect to this replica set.
352352
"""
353353
return self.__seeds
354354

355355
@property
356356
def hosts(self):
357-
"""All active hosts known to this replica set.
357+
"""All active and passive (priority 0) replica set
358+
members known to this connection. This does not include
359+
hidden or slaveDelay members, or arbiters.
358360
"""
359361
return self.__hosts
360362

@@ -368,13 +370,13 @@ def primary(self):
368370

369371
@property
370372
def secondaries(self):
371-
"""The secondary nodes in this replica set.
373+
"""The secondary members known to this connection.
372374
"""
373-
return self.__readers
375+
return set(self.__readers)
374376

375377
@property
376378
def arbiters(self):
377-
"""All arbiters known to this replica set.
379+
"""The arbiters known to this connection.
378380
"""
379381
return self.__arbiters
380382

test/replica/test_replica_set.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def test_passive_and_hidden(self):
130130
passives = [_partition_node(member) for member in passives]
131131
hidden = replset_tools.get_hidden_members()
132132
hidden = [_partition_node(member) for member in hidden]
133-
self.assertEqual(c.secondaries, passives)
133+
self.assertEqual(c.secondaries, set(passives))
134134

135135
for _ in xrange(10):
136136
cursor = db.test.find()

0 commit comments

Comments
 (0)