From 559e12c1fbd05f3edb34a466f7da61662f23d129 Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Tue, 15 Oct 2019 18:18:46 +0300 Subject: [PATCH] A bunch of error messages converted to python3 syntax --- monkey/common/cloud/aws_service.py | 2 +- monkey/infection_monkey/exploit/tools/wmi_tools.py | 2 +- monkey/monkey_island/cc/services/reporting/aws_exporter.py | 4 ++-- .../cc/services/reporting/report_exporter_manager.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/monkey/common/cloud/aws_service.py b/monkey/common/cloud/aws_service.py index 41bb202bc..b435b23c7 100644 --- a/monkey/common/cloud/aws_service.py +++ b/monkey/common/cloud/aws_service.py @@ -84,5 +84,5 @@ class AwsService(object): filtered_instances_data = filter_instance_data_from_aws_response(response) return filtered_instances_data except botocore.exceptions.ClientError as e: - logger.warning("AWS client error while trying to get instances: " + e.message) + logger.warning("AWS client error while trying to get instances: " + e) raise e diff --git a/monkey/infection_monkey/exploit/tools/wmi_tools.py b/monkey/infection_monkey/exploit/tools/wmi_tools.py index f9f7b9ae3..e1e002d72 100644 --- a/monkey/infection_monkey/exploit/tools/wmi_tools.py +++ b/monkey/infection_monkey/exploit/tools/wmi_tools.py @@ -48,7 +48,7 @@ class WmiTools(object): except Exception as exc: dcom.disconnect() - if "rpc_s_access_denied" == exc.message: + if "rpc_s_access_denied" == exc: raise AccessDeniedException(host, username, password, domain) raise diff --git a/monkey/monkey_island/cc/services/reporting/aws_exporter.py b/monkey/monkey_island/cc/services/reporting/aws_exporter.py index b01f349d4..0940be503 100644 --- a/monkey/monkey_island/cc/services/reporting/aws_exporter.py +++ b/monkey/monkey_island/cc/services/reporting/aws_exporter.py @@ -107,10 +107,10 @@ class AWSExporter(Exporter): else: return False except UnknownServiceError as e: - logger.warning('AWS exporter called but AWS-CLI securityhub service is not installed. Error: ' + e.message) + logger.warning('AWS exporter called but AWS-CLI securityhub service is not installed. Error: ' + e) return False except Exception as e: - logger.exception('AWS security hub findings failed to send. Error: ' + e.message) + logger.exception('AWS security hub findings failed to send. Error: ' + e) return False @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 index f308a7933..865556b0d 100644 --- a/monkey/monkey_island/cc/services/reporting/report_exporter_manager.py +++ b/monkey/monkey_island/cc/services/reporting/report_exporter_manager.py @@ -30,4 +30,4 @@ class ReportExporterManager(object, metaclass=Singleton): try: exporter().handle_report(report) except Exception as e: - logger.exception('Failed to export report, error: ' + e.message) + logger.exception('Failed to export report, error: ' + e)