From 7e9c481992296deef9b5bc2b8bf7a3cee9c81b76 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 17 Jun 2022 08:22:14 -0400 Subject: [PATCH] Common: Rename marshmallow post_load methods to be protected --- monkey/common/configuration/agent_configuration.py | 14 +++++++------- vulture_allowlist.py | 11 ++++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/monkey/common/configuration/agent_configuration.py b/monkey/common/configuration/agent_configuration.py index 550d58d01..aa716a7a6 100644 --- a/monkey/common/configuration/agent_configuration.py +++ b/monkey/common/configuration/agent_configuration.py @@ -22,7 +22,7 @@ class CustomPBAConfigurationSchema(Schema): windows_filename = fields.Str() @post_load - def make_custom_pba_configuration(self, data, **kwargs): + def _make_custom_pba_configuration(self, data, **kwargs): return CustomPBAConfiguration(**data) @@ -37,7 +37,7 @@ class PluginConfigurationSchema(Schema): options = fields.Mapping() @post_load - def make_plugin_configuration(self, data, **kwargs): + def _make_plugin_configuration(self, data, **kwargs): return PluginConfiguration(**data) @@ -50,7 +50,7 @@ class ExploitationOptionsConfigurationSchema(Schema): http_ports = fields.List(fields.Int()) @post_load - def make_exploitation_options_configuration(self, data, **kwargs): + def _make_exploitation_options_configuration(self, data, **kwargs): return ExploitationOptionsConfiguration(**data) @@ -67,7 +67,7 @@ class ExploiterConfigurationSchema(Schema): supported_os = fields.List(EnumField(OperatingSystems)) @post_load - def make_exploiter_configuration(self, data, **kwargs): + def _make_exploiter_configuration(self, data, **kwargs): return ExploiterConfiguration(**data) @@ -84,7 +84,7 @@ class ExploitationConfigurationSchema(Schema): vulnerability = fields.List(fields.Nested(ExploiterConfigurationSchema)) @post_load - def make_exploitation_options_configuration(self, data, **kwargs): + def _make_exploitation_options_configuration(self, data, **kwargs): return ExploitationConfiguration(**data) @@ -105,7 +105,7 @@ class ICMPScanConfigurationSchema(Schema): timeout_ms = fields.Int() @post_load - def make_icmp_scan_configuration(self, data, **kwargs): + def _make_icmp_scan_configuration(self, data, **kwargs): return ICMPScanConfiguration(**data) @@ -120,5 +120,5 @@ class TCPScanConfigurationSchema(Schema): ports = fields.List(fields.Int()) @post_load - def make_tcp_scan_configuration(self, data, **kwargs): + def _make_tcp_scan_configuration(self, data, **kwargs): return TCPScanConfiguration(**data) diff --git a/vulture_allowlist.py b/vulture_allowlist.py index c38586f72..fcdefe8a0 100644 --- a/vulture_allowlist.py +++ b/vulture_allowlist.py @@ -186,11 +186,12 @@ response_code # unused variable (monkey/monkey_island/cc/services/aws/aws_comma # Agent Configuration Meta # unused class (monkey/common/configuration/agent_configuration.py:13) unknown # unused variable (monkey/common/configuration/agent_configuration.py:14) -make_plugin_configuration # unused method (monkey/common/configuration/agent_configuration.py:19) -make_custom_pba_configuration # unused method (monkey/common/configuration/agent_configuration.py:34) -make_exploitation_options_configuration # unused method (monkey/common/configuration/agent_configuration.py:58) -make_exploiter_configuration # unused method (monkey/common/configuration/agent_configuration.py:62) -make_tcp_scan_configuration # unused method (monkey/common/configuration/agent_configuration.py:114) +_make_plugin_configuration # unused method (monkey/common/configuration/agent_configuration.py:19) +_make_custom_pba_configuration # unused method (monkey/common/configuration/agent_configuration.py:24) +_make_exploiter_configuration # unused method (monkey/common/configuration/agent_configuration.py:69) +_make_exploitation_options_configuration # unused method (monkey/common/configuration/agent_configuration.py:86) +_make_icmp_scan_configuration # unused method (monkey/common/configuration/agent_configuration.py:107) +_make_tcp_scan_configuration # unused method (monkey/common/configuration/agent_configuration.py:122) LINUX # unused variable (monkey/common/operating_systems.py:5) WINDOWS # unused variable (monkey/common/operating_systems.py:6)