I think you're confusing PyMongo with the mongo javascript shell. See my response to your last question for how to get the replica set configuration using PyMongo. PyMongo's Connection class does not have a reconfig method.
To see how rs.reconfig works in the shell:
repl0:PRIMARY> rs.reconfig
function (cfg, options) {
cfg.version = rs.conf().version + 1;
cmd = { replSetReconfig: cfg };
for (var i in options) {
cmd[i] = options[i];
}
return this._runCmd(cmd);
}
So you want to run the command "replSetReconfig" using PyMongo's Database.command method.
Here's a full example:
First, get the replica set config:
>>> import pymongo
>>> c = pymongo.Connection()
>>> conf = c.local.system.replset.find_one()
>>> conf
{u'_id': u'repl0', u'version': 3, u'members': [{u'host': u'devbox:27017', u'_id': 0}, {u'host': u'devbox:27018', u'_id': 1}, {u'host': u'devbox:27019', u'_id': 2}]}
Next delete the member you no longer want:
>>> del conf['members'][2]
>>> conf
{u'_id': u'repl0', u'version': 3, u'members': [{u'host': u'devbox:27017', u'_id': 0}, {u'host': u'devbox:27018', u'_id': 1}]}
Bump the config version:
>>> conf['version'] += 1
>>> conf
{u'_id': u'repl0', u'version': 4, u'members': [{u'host': u'devbox:27017', u'_id': 0}, {u'host': u'devbox:27018', u'_id': 1}]}
Run replSetReconfig:
>>> c.admin.command({'replSetReconfig': conf})
There will be a traceback with AutoReconnect here since 'replSetReconfig' causes the primary to temporarily close connections...
Now check that everything worked as expected.
>>> c.local.system.replset.find_one()
{u'_id': u'repl0', u'version': 4, u'members': [{u'host': u'devbox:27017', u'_id': 0}, {u'host': u'devbox:27018', u'_id': 1}]}
This is how you run rs.status() in python:
>>> c.admin.command('replSetGetStatus')
{u'date': datetime.datetime(2012, 11, 17, 16, 20, 8), u'myState': 1, u'set': u'repl0', u'ok': 1.0, u'members': [{u'uptime': 37661, u'optime': Timestamp(1353169155, 1), u'name': u'devbox:27017', u'self': True, u'optimeDate': datetime.datetime(2012, 11, 17, 16, 19, 15), u'state': 1, u'health': 1.0, u'stateStr': u'PRIMARY', u'_id': 0}, {u'uptime': 53, u'optime': Timestamp(1353169155, 1), u'name': u'devbox:27018', u'pingMs': 0, u'optimeDate': datetime.datetime(2012, 11, 17, 16, 19, 15), u'state': 2, u'health': 1.0, u'lastHeartbeatMessage': u'syncing to: devbox:27017', u'stateStr': u'SECONDARY', u'lastHeartbeatRecv': datetime.datetime(1970, 1, 1, 0, 0), u'_id': 1, u'lastHeartbeat': datetime.datetime(2012, 11, 17, 16, 20, 7)}]}