MCPcopy Index your code
hub / github.com/blacklanternsecurity/bbot / _setup

Method _setup

bbot/modules/base.py:690–715  ·  view source on GitHub ↗

(self, deps_only=False)

Source from the content-addressed store, hash-verified

688 self._tasks.append(watchdog_task)
689
690 async def _setup(self, deps_only=False):
691 """ """
692 status_codes = {False: "hard-fail", None: "soft-fail", True: "success"}
693
694 status = False
695 self.debug(f"Setting up module {self.name}")
696 try:
697 funcs = [self.setup_deps]
698 if not deps_only:
699 funcs.append(self.setup)
700 for func in funcs:
701 self.debug(f"Running {self.name}.{func.__name__}()")
702 result = await func()
703 if type(result) == tuple and len(result) == 2:
704 status, msg = result
705 else:
706 status = result
707 msg = status_codes[status]
708 if status is False:
709 break
710 self.debug(f"Finished setting up module {self.name}")
711 except Exception as e:
712 self.set_error_state(f"Unexpected error during module setup: {e}", critical=True)
713 msg = f"{e}"
714 self.trace()
715 return self, status, str(msg)
716
717 async def _worker(self):
718 """

Callers 1

setup_modulesMethod · 0.80

Calls 3

debugMethod · 0.95
set_error_stateMethod · 0.95
traceMethod · 0.95

Tested by

no test coverage detected