From 6120e6bf89aedbaf5baf7af56c165e1a99456610 Mon Sep 17 00:00:00 2001 From: Kirill Date: Fri, 18 Oct 2024 14:25:06 +0000 Subject: [PATCH] feat: reimplement builder --- plugins/aws/fix_plugin_aws/resource/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/aws/fix_plugin_aws/resource/base.py b/plugins/aws/fix_plugin_aws/resource/base.py index 2397950716..10381db9c6 100644 --- a/plugins/aws/fix_plugin_aws/resource/base.py +++ b/plugins/aws/fix_plugin_aws/resource/base.py @@ -487,6 +487,7 @@ def __init__( graph_nodes_access: Optional[RWLock] = None, graph_edges_access: Optional[RWLock] = None, last_run_started_at: Optional[datetime] = None, + assessment_findings: Optional[Dict[Tuple[str, str, str], Dict[str, List[Finding]]]] = None, ) -> None: self.graph = graph self.cloud = cloud @@ -503,8 +504,8 @@ def __init__( self.last_run_started_at = last_run_started_at self.created_at = utc() self.__builder_cache = {region.safe_name: self} - self._assessment_findings: Dict[Tuple[str, str, str], Dict[str, List[Finding]]] = defaultdict( - lambda: defaultdict(list) + self._assessment_findings: Dict[Tuple[str, str, str], Dict[str, List[Finding]]] = ( + assessment_findings or defaultdict(lambda: defaultdict(list)) ) """ AWS assessment findings that hold a list of AwsInspectorFinding or AwsGuardDutyFinding. @@ -754,6 +755,7 @@ def for_region(self, region: AwsRegion) -> GraphBuilder: self.graph_nodes_access, self.graph_edges_access, self.last_run_started_at, + self._assessment_findings, ) self.__builder_cache[region.safe_name] = builder return builder