Revert "Create subunit proccessor subclass"
This reverts commit 135ac1809d
.
EventProcessor was called before being defined. The code also doesn't
look entirely right. Reverting this to fix up the logstash servers
Change-Id: I2fb8081426646565814090c152d04d7349c16945
This commit is contained in:
parent
75ed9aca88
commit
cd55cdf7d7
|
@ -36,14 +36,6 @@ except ImportError:
|
||||||
import daemon.pidfile as pidfile_mod
|
import daemon.pidfile as pidfile_mod
|
||||||
|
|
||||||
|
|
||||||
class SubunitProcessor(EventProcessor):
|
|
||||||
def __init__(self, zmq_address, gearman_client, files, source_url):
|
|
||||||
super(SubunitProcessor, self).__init__(zmq_address, gearman_client,
|
|
||||||
files, source_url)
|
|
||||||
|
|
||||||
def _make_gear_job(self, output):
|
|
||||||
return gear.Job(b'push-subunit', json.dumps(output).encode('utf8'))
|
|
||||||
|
|
||||||
class EventProcessor(threading.Thread):
|
class EventProcessor(threading.Thread):
|
||||||
def __init__(self, zmq_address, gearman_client, files, source_url):
|
def __init__(self, zmq_address, gearman_client, files, source_url):
|
||||||
threading.Thread.__init__(self)
|
threading.Thread.__init__(self)
|
||||||
|
@ -94,15 +86,16 @@ class EventProcessor(threading.Thread):
|
||||||
output['source_url'] = source_url
|
output['source_url'] = source_url
|
||||||
output['retry'] = fileopts.get('retry-get', False)
|
output['retry'] = fileopts.get('retry-get', False)
|
||||||
output['event'] = out_event
|
output['event'] = out_event
|
||||||
job = _make_gear_job(output)
|
if 'subunit' in fileopts.get('name'):
|
||||||
|
job = gear.Job(b'push-subunit',
|
||||||
|
json.dumps(output).encode('utf8'))
|
||||||
|
else:
|
||||||
|
job = gear.Job(b'push-log', json.dumps(output).encode('utf8'))
|
||||||
try:
|
try:
|
||||||
self.gearman_client.submitJob(job)
|
self.gearman_client.submitJob(job)
|
||||||
except:
|
except:
|
||||||
logging.exception("Exception submitting job to Gearman.")
|
logging.exception("Exception submitting job to Gearman.")
|
||||||
|
|
||||||
def _make_gear_job(self, output):
|
|
||||||
return gear.Job(b'push-log', json.dumps(output).encode('utf8'))
|
|
||||||
|
|
||||||
def _get_log_dir(self, event):
|
def _get_log_dir(self, event):
|
||||||
parameters = event["build"].get("parameters", {})
|
parameters = event["build"].get("parameters", {})
|
||||||
base = parameters.get('LOG_PATH', 'UNKNOWN')
|
base = parameters.get('LOG_PATH', 'UNKNOWN')
|
||||||
|
@ -174,7 +167,7 @@ class Server(object):
|
||||||
log_processor = EventProcessor(
|
log_processor = EventProcessor(
|
||||||
publisher, gearclient,
|
publisher, gearclient,
|
||||||
self.config['source-files'], self.source_url)
|
self.config['source-files'], self.source_url)
|
||||||
subunit_processor = SubunitProcessor(
|
subunit_processor = EventProcessor(
|
||||||
publisher, gearclient,
|
publisher, gearclient,
|
||||||
self.config['subunit-files'], self.source_url)
|
self.config['subunit-files'], self.source_url)
|
||||||
self.processors.append(log_processor)
|
self.processors.append(log_processor)
|
||||||
|
|
Loading…
Reference in New Issue