def run(self, data): """Generates all reports. @param data: analysis results. @raise CuckooReportError: if a report module fails. """ Report() for plugin in Report.__subclasses__(): self._run_report(plugin, data)
def run(self, data): """Generates all reports. @param data: analysis results. @raise CuckooReportError: if a report module fails. """ Report() for plugin in Report.__subclasses__(): current = plugin() current.set_path(self.analysis_path) current.cfg = Config(current.conf_path) module = inspect.getmodule(current) module_name = module.__name__.rsplit(".", 1)[1] current.set_options(self.cfg.get(module_name)) try: # Run report, for each report a brand new copy of results is # created, to prevent a reporting module to edit global # result set and affect other reporting modules. current.run(copy.deepcopy(data)) log.debug("Executed reporting module \"%s\"" % current.__class__.__name__) except NotImplementedError: continue except CuckooReportError as e: log.warning("Failed to execute reporting module \"%s\": %s" % (current.__class__.__name__, e.message))