MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / load_action

Method load_action

utils.py:71–85  ·  view source on GitHub ↗

Load an action from the actions file

(self, module_name, action)

Source from the content-addressed store, hash-verified

69 self.nmap_vuln_scanner = NmapVulnScanner(self.shared_data)
70
71 def load_action(self, module_name, action):
72 """Load an action from the actions file"""
73 module = importlib.import_module(f'actions.{module_name}')
74 try:
75 b_class = action["b_class"]
76 action_instance = getattr(module, b_class)(self.shared_data)
77 action_instance.action_name = b_class
78 action_instance.port = action.get("b_port")
79 action_instance.b_parent_action = action.get("b_parent")
80 if action_instance.port == 0:
81 self.standalone_actions.append(action_instance)
82 else:
83 self.actions.append(action_instance)
84 except AttributeError as e:
85 self.logger.error(f"Module {module_name} is missing required attributes: {e}")
86
87 def serve_netkb_data_json(self, handler):
88 try:

Callers 1

load_actionsMethod · 0.95

Calls 3

appendMethod · 0.80
errorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected