def get_implementation(self): if self.implementation: config = config_from_configman() if self.implementation_config_namespace: config = config[self.implementation_config_namespace] return self.implementation(config=config) return None
def handle(self, **options): config = config_from_configman()["elasticsearch"] conn = ConnectionContext(config) indices = conn.delete_expired_indices() if indices: self.stdout.write("Deleting expired crash report indices.") for index in indices: self.stdout.write("Deleting %s" % index) else: self.stdout.write("No expired indices to delete.")
def es_conn(): """Create an Elasticsearch ConnectionContext and clean up indices afterwards.""" conn = ConnectionContext(config_from_configman()["elasticsearch"]) yield conn for index in conn.get_indices(): conn.delete_index(index)
def es_conn(): """Create an Elasticsearch ConnectionContext and clean up indices afterwards.""" conn = ConnectionContext(config_from_configman()['elasticsearch']) yield conn for index in conn.get_indices(): conn.delete_index(index)