示例#1
0
文件: models.py 项目: xincun/socorro
 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
示例#2
0
文件: models.py 项目: mozilla/socorro
 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
示例#3
0
 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.")
示例#4
0
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)
示例#5
0
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)