From 271461779753c40fd01b479c7e90ba8542e353a2 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Mon, 2 May 2022 09:10:37 -0400 Subject: [PATCH] Agent: Use AwsInstance instead of aws_service --- monkey/infection_monkey/utils/aws_environment_check.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/monkey/infection_monkey/utils/aws_environment_check.py b/monkey/infection_monkey/utils/aws_environment_check.py index fe7316e57..203882425 100644 --- a/monkey/infection_monkey/utils/aws_environment_check.py +++ b/monkey/infection_monkey/utils/aws_environment_check.py @@ -1,6 +1,6 @@ import logging -from common.aws import aws_service +from common.aws.aws_instance import AwsInstance from infection_monkey.telemetry.aws_instance_telem import AWSInstanceTelemetry from infection_monkey.telemetry.messengers.legacy_telemetry_messenger_adapter import ( LegacyTelemetryMessengerAdapter, @@ -13,9 +13,9 @@ logger = logging.getLogger(__name__) def _report_aws_environment(telemetry_messenger: LegacyTelemetryMessengerAdapter): logger.info("Collecting AWS info") - aws_instance = aws_service.initialize() + aws_instance = AwsInstance() - if aws_service.is_on_aws(): + if aws_instance.is_instance: logger.info("Machine is an AWS instance") telemetry_messenger.send_telemetry(AWSInstanceTelemetry(aws_instance.instance_id)) else: