get logging test endpoint to work again

The handler and formatter classes are expecting an object
and the previous method passed a dict, so this change converts
the data into a mock settings object.
This commit is contained in:
AlanCoding
2017-06-28 14:17:46 -04:00
parent 7d283f1dfd
commit c1ff41fa45
3 changed files with 14 additions and 18 deletions

View File

@@ -22,7 +22,7 @@ class LogstashFormatter(LogstashFormatterVersion1):
settings_module = kwargs.pop('settings_module', None)
ret = super(LogstashFormatter, self).__init__(**kwargs)
if settings_module:
self.host_id = settings_module.CLUSTER_HOST_ID
self.host_id = getattr(settings_module, 'CLUSTER_HOST_ID', None)
if hasattr(settings_module, 'LOG_AGGREGATOR_TOWER_UUID'):
self.tower_uuid = settings_module.LOG_AGGREGATOR_TOWER_UUID
self.message_type = getattr(settings_module, 'LOG_AGGREGATOR_TYPE', 'other')