Allow worker to make use of subunit2sql targets

A plugin interface has been added, so make sure we load them. This will
allow us to eventually ingest counters while processing the stream.

Change-Id: I0614986eeae3c6f4681162c755311eab5a730862
Depends-On: Id16c87382f3767982ce815d129ae56a941375546
Implements: counter-inspection
This commit is contained in:
Clint Byrum 2015-11-11 18:03:46 -08:00
parent ab6e196aa4
commit 390f44eb0e
1 changed files with 4 additions and 1 deletions

View File

@ -170,7 +170,9 @@ class Subunit2SQLProcessor(object):
self.config = subunit2sql_conf
# Initialize subunit2sql settings
shell.cli_opts()
extensions = shell.get_extensions()
shell.parse_args([], [self.config])
self.extra_targets = shell.get_targets(extensions)
def handle_subunit_event(self):
# Pull subunit event from queue and separate stream from metadata
@ -184,7 +186,8 @@ class Subunit2SQLProcessor(object):
shell.CONF.set_override('run_meta', subunit)
# Parse subunit stream and store in DB
logging.debug('Converting Subunit V2 stream to SQL')
stream = read_subunit.ReadSubunit(subunit_v2)
stream = read_subunit.ReadSubunit(subunit_v2,
targets=self.extra_targets)
shell.process_results(stream.get_results())