From b6949d060db53b6933b7a7bd76fa17bda6cba126 Mon Sep 17 00:00:00 2001 From: Raphael Cohen Date: Fri, 20 Oct 2023 09:12:25 +0200 Subject: [PATCH] fix: Do not generate trigger manifest for connectors --- sekoia_automation/scripts/files_generator.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sekoia_automation/scripts/files_generator.py b/sekoia_automation/scripts/files_generator.py index 3bb926b..abec066 100644 --- a/sekoia_automation/scripts/files_generator.py +++ b/sekoia_automation/scripts/files_generator.py @@ -32,6 +32,7 @@ def inspect_module( modules: set[type[Module]], actions: set[type[Action]], triggers: set[type[Trigger]], + connectors: set[type[Connector]], ): module = import_module(name) @@ -39,6 +40,8 @@ def inspect_module( if not isabstract(obj): if issubclass(obj, Action): actions.add(obj) + elif issubclass(obj, Connector): + connectors.add(obj) elif issubclass(obj, Trigger): triggers.add(obj) elif issubclass(obj, Module) and obj != Module: @@ -58,10 +61,11 @@ def execute(self): modules = set() actions = set() triggers = set() + connectors = set() for _, name, ispkg in walk_packages([self.base_path.as_posix()]): if not ispkg and not (name == "tests" or name.startswith("tests.")): - self.inspect_module(name, modules, actions, triggers) + self.inspect_module(name, modules, actions, triggers, connectors) if len(modules) != 1: print("[bold red][!] Found 0 or more than 1 module, aborting[/bold red]") @@ -71,7 +75,7 @@ def execute(self): self.generate_main(module, actions, triggers) self.generate_action_manifests(actions) self.generate_trigger_manifests(triggers) - self.generate_connector_manifests(triggers) + self.generate_connector_manifests(connectors) self.update_module_manifest(module) sys.path = _old_path