diff --git a/monkey/monkey_island/cc/services/reporting/exporter_init.py b/monkey/monkey_island/cc/services/reporting/exporter_init.py deleted file mode 100644 index 5eb640ee7..000000000 --- a/monkey/monkey_island/cc/services/reporting/exporter_init.py +++ /dev/null @@ -1,28 +0,0 @@ -import logging - -from monkey_island.cc.services import aws_service -from monkey_island.cc.services.reporting.aws_exporter import AWSExporter -from monkey_island.cc.services.reporting.report_exporter_manager import ReportExporterManager - -logger = logging.getLogger(__name__) - - -def populate_exporter_list(): - manager = ReportExporterManager() - # try_add_aws_exporter_to_manager(manager) - - if len(manager.get_exporters_list()) != 0: - logger.debug( - "Populated exporters list with the following exporters: {0}".format( - str(manager.get_exporters_list()) - ) - ) - - -def try_add_aws_exporter_to_manager(manager): - # noinspection PyBroadException - try: - if aws_service.is_on_aws(): - manager.add_exporter_to_list(AWSExporter) - except Exception: - logger.error("Failed adding aws exporter to manager. Exception info:", exc_info=True) diff --git a/monkey/monkey_island/cc/services/reporting/report.py b/monkey/monkey_island/cc/services/reporting/report.py index 6969ef5fc..69a252580 100644 --- a/monkey/monkey_island/cc/services/reporting/report.py +++ b/monkey/monkey_island/cc/services/reporting/report.py @@ -497,7 +497,7 @@ class ReportService: "meta_info": {"latest_monkey_modifytime": monkey_latest_modify_time}, } save_report(report) - aws_exporter.handle_report(report, ReportService._aws_service.island_aws_instance()) + aws_exporter.handle_report(report, ReportService._aws_service.island_aws_instance) return report @staticmethod diff --git a/monkey/monkey_island/cc/services/reporting/report_exporter_manager.py b/monkey/monkey_island/cc/services/reporting/report_exporter_manager.py deleted file mode 100644 index a71679685..000000000 --- a/monkey/monkey_island/cc/services/reporting/report_exporter_manager.py +++ /dev/null @@ -1,24 +0,0 @@ -import logging - -from common.utils.code_utils import Singleton - -logger = logging.getLogger(__name__) - - -class ReportExporterManager(object, metaclass=Singleton): - def __init__(self): - self._exporters_set = set() - - def get_exporters_list(self): - return self._exporters_set - - def add_exporter_to_list(self, exporter): - self._exporters_set.add(exporter) - - def export(self, report): - for exporter in self._exporters_set: - logger.debug("Trying to export using " + repr(exporter)) - try: - exporter().handle_report(report) - except Exception as e: - logger.exception("Failed to export report, error: " + e)