def create_index(self, collection, index_name, **kwargs):
        """Safely attempt to create index."""
        try:
            self.connection[collection].create_index(index_name, **kwargs)
        except Exception as exc:
            LOG.warn("Error tuning mongodb database: %s", exc)
def create_index ( self , collection , index_name , ** kwargs ) : try : self . connection [ collection ] . create_index ( index_name , ** kwargs ) except Exception as exc : LOG . warn ( "Error tuning mongodb database: %s" , exc )
Safely attempt to create index.