-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 1.11
-
Component/s: None
-
None
-
Fully Compatible
Similar to PHP-136, the pymongo driver should allow querying a GridFS collection from a slave. Currently, if one attempts to open a GridFS object on a slave connection, a traceback is returned:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jaraco/envs/beta/lib/python2.7/site-packages/pymongo-1.11-py2.7-linux-x86_64.egg/gridfs/_init.py", line 58, in __init_
unique=True)
File "/home/jaraco/envs/beta/lib/python2.7/site-packages/pymongo-1.11-py2.7-linux-x86_64.egg/pymongo/collection.py", line 724, in ensure_index
ttl, **kwargs)
File "/home/jaraco/envs/beta/lib/python2.7/site-packages/pymongo-1.11-py2.7-linux-x86_64.egg/pymongo/collection.py", line 646, in create_index
safe=True)
File "/home/jaraco/envs/beta/lib/python2.7/site-packages/pymongo-1.11-py2.7-linux-x86_64.egg/pymongo/collection.py", line 275, in insert
check_keys, safe, kwargs), safe)
File "/home/jaraco/envs/beta/lib/python2.7/site-packages/pymongo-1.11-py2.7-linux-x86_64.egg/pymongo/connection.py", line 774, in _send_message
raise AutoReconnect(str(e))
pymongo.errors.AutoReconnect: not master