store results

This commit is contained in:
Ben Rudolph
2018-03-23 17:43:50 -07:00
parent 3407994e00
commit d5b3c2e303

View File

@ -45,6 +45,7 @@ class ETLCommand(BaseCommand):
self.logger.info(*args, **kwargs) self.logger.info(*args, **kwargs)
def run(self, *args, **options): def run(self, *args, **options):
results = []
with bonobo.parse_args(options) as options: with bonobo.parse_args(options) as options:
services = self.get_services() services = self.get_services()
graph_coll = self.get_graph(*args, **options) graph_coll = self.get_graph(*args, **options)
@ -56,9 +57,12 @@ class ETLCommand(BaseCommand):
assert isinstance(graph, bonobo.Graph), 'Invalid graph provided.' assert isinstance(graph, bonobo.Graph), 'Invalid graph provided.'
print(term.lightwhite('{}. {}'.format(i + 1, graph.name))) print(term.lightwhite('{}. {}'.format(i + 1, graph.name)))
result = bonobo.run(graph, services=services) result = bonobo.run(graph, services=services)
results.append(result)
print(term.lightblack(' ... return value: ' + str(result))) print(term.lightblack(' ... return value: ' + str(result)))
print() print()
return results
def handle(self, *args, **options): def handle(self, *args, **options):
_stdout_backup, _stderr_backup = self.stdout, self.stderr _stdout_backup, _stderr_backup = self.stdout, self.stderr