Added init of AwsService to beginning of server lifetime

This commit is contained in:
Shay Nehmad 2019-04-23 13:30:39 +03:00
parent 7f0418f91b
commit 1965180487
2 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,7 @@ from monkey_island.cc.resources.telemetry import Telemetry
from monkey_island.cc.resources.telemetry_feed import TelemetryFeed
from monkey_island.cc.services.config import ConfigService
from monkey_island.cc.consts import MONKEY_ISLAND_ABS_PATH
from monkey_island.cc.services.remote_run_aws import RemoteRunAwsService
__author__ = 'Barak'
@ -98,6 +99,9 @@ def init_app(mongo_url):
database.init()
ConfigService.init_config()
# If on AWS, this will set the instance - for usage later in the code.
RemoteRunAwsService.init()
app.add_url_rule('/', 'serve_home', serve_home)
app.add_url_rule('/<path:static_path>', 'serve_static_file', serve_static_file)

View File

@ -9,6 +9,7 @@ logger = logging.getLogger(__name__)
def populate_exporter_list():
manager = ReportExporterManager()
RemoteRunAwsService.init()
if RemoteRunAwsService.is_running_on_aws():
manager.add_exporter_to_list(AWSExporter)