def output(self, output_formats): """ output all results to appropriate URLs - output_formats: a dict mapping formats to a list of URLs """ tbpl_output = {} try: for key, urls in output_formats.items(): _output = output.Output(self) results = _output() for url in urls: _output.output(results, url, tbpl_output) except utils.TalosError as e: # print to results.out try: _output = output.GraphserverOutput(self) results = _output() _output.output( 'file://%s' % os.path.join(os.getcwd(), 'results.out'), results) except: pass print('\nFAIL: %s' % str(e).replace('\n', '\nRETURN:')) raise e if tbpl_output: print("TinderboxPrint: TalosResult: %s" % json.dumps(tbpl_output))
def output(self, output_formats): """ output all results to appropriate URLs - output_formats: a dict mapping formats to a list of URLs """ try: for key, urls in output_formats.items(): _output = output.Output(self, Results) results = _output() for url in urls: _output.output(results, url) except utils.TalosError as e: # print to results.out try: _output = output.GraphserverOutput(self) results = _output() _output.output( "file://%s" % os.path.join(os.getcwd(), "results.out"), results) except Exception: pass print("\nFAIL: %s" % str(e).replace("\n", "\nRETURN:")) raise e