Properly root log path in logstash gearman client.

* modules/openstack_project/files/logstash/log-gearman-client.py:
BASE_LOG_PATH is a relative dir and is not rooted. Provide the root '/'
when constructing the source URL for the gearman workers.

Change-Id: I8fcfa19b048019398ffd370d74c271b9656a8688
This commit is contained in:
Clark Boylan 2013-07-19 11:38:26 -07:00
parent a14f6a5f1e
commit 0e66fcdce1

View File

@ -76,7 +76,7 @@ class EventProcessor(threading.Thread):
def _get_log_dir(self, event):
parameters = event["build"].get("parameters", {})
base = parameters.get('BASE_LOG_PATH', '/periodic')
base = parameters.get('BASE_LOG_PATH', 'periodic')
base += '/{name}/{number}/'.format(
name=event.get("name", "UNKNOWN"),
number=event["build"].get("number", "UNKNOWN"))
@ -102,7 +102,7 @@ class EventProcessor(threading.Thread):
def _parse_event(self, event, fileopts):
fields = self._parse_fields(event, fileopts['name'])
log_dir = self._get_log_dir(event)
source_url = fileopts.get('source-url', self.source_url) + \
source_url = fileopts.get('source-url', self.source_url) + '/' + \
log_dir + fileopts['name']
out_event = {}
out_event["@fields"] = fields