def config(self):
        """return replica set config, use rs.conf() command"""
        try:
            admin = self.connection().admin
            config = admin.command('replSetGetConfig')['config']
        except pymongo.errors.OperationFailure:
            # replSetGetConfig was introduced in 2.7.5.
            config = self.connection().local.system.replset.find_one()
        return config
def config ( self ) : try : admin = self . connection ( ) . admin config = admin . command ( 'replSetGetConfig' ) [ 'config' ] except pymongo . errors . OperationFailure : config = self . connection ( ) . local . system . replset . find_one ( ) return config
return replica set config, use rs.conf() command