Esempio n. 1
0
 def __init__(self):
     self.name = PROFILER_CONF.get('facility_name', 'horizon')
     self.hmac_keys = PROFILER_CONF.get('keys', [])
     if PROFILER_ENABLED:
         api.init_notifier(PROFILER_CONF.get('notifier_connection_string'))
     else:
         raise exceptions.MiddlewareNotUsed()
Esempio n. 2
0
 def __init__(self):
     self.name = PROFILER_CONF.get('facility_name', 'horizon')
     self.hmac_keys = PROFILER_CONF.get('keys', [])
     if PROFILER_ENABLED:
         api.init_notifier(PROFILER_CONF.get('notifier_connection_string'))
     else:
         raise exceptions.MiddlewareNotUsed()
Esempio n. 3
0
 def __init__(self, get_response):
     self.name = PROFILER_CONF['facility_name']
     self.hmac_keys = PROFILER_CONF['keys']
     self.get_response = get_response
     if PROFILER_ENABLED:
         api.init_notifier(PROFILER_CONF['notifier_connection_string'])
     else:
         raise exceptions.MiddlewareNotUsed()
Esempio n. 4
0
 def __init__(self):
     self.name = PROFILER_SETTINGS.get('facility_name', 'horizon')
     self.hmac_keys = PROFILER_SETTINGS.get('keys')
     self._enabled = PROFILER_SETTINGS.get('enabled', False)
     if self._enabled:
         api.init_notifier(PROFILER_SETTINGS.get(
             'notifier_connection_string', 'mongodb://'))
     else:
         raise exceptions.MiddlewareNotUsed()
Esempio n. 5
0
 def __init__(self, get_response):
     self.name = horizon_settings.get_dict_config('OPENSTACK_PROFILER',
                                                  'facility_name')
     self.hmac_keys = horizon_settings.get_dict_config(
         'OPENSTACK_PROFILER', 'keys')
     self.get_response = get_response
     if PROFILER_ENABLED:
         api.init_notifier(
             horizon_settings.get_dict_config('OPENSTACK_PROFILER',
                                              'notifier_connection_string'))
     else:
         raise exceptions.MiddlewareNotUsed()